

import warnings
from collections.abc import Callable
from typing import Any

import numpy
from matplotlib import pyplot

lowerCamelCase									= 0.25 + 0.0j
lowerCamelCase									= -0.4 + 0.6j
lowerCamelCase									= -0.1 + 0.651j
lowerCamelCase									= -2.0
lowerCamelCase									= 56
lowerCamelCase									= 2.0
lowerCamelCase									= 666




def       UpperCAmelCase__    (      _A				:			complex     ,				_A				:			numpy.ndarray							):





  '''simple docstring'''







  return numpy.exp(_A							) + c_parameter




def       UpperCAmelCase__    (      _A				:			complex     ,				_A				:			numpy.ndarray							):





  '''simple docstring'''







  return z_values * z_values + c_parameter




def       UpperCAmelCase__    (      _A				:			float     ,				_A				:			int							):





  '''simple docstring'''







  a__  =numpy.linspace(-window_size     ,				_A     ,				_A							)
  a__  =x.reshape((nb_pixels, 1)							)
  a__  =numpy.linspace(-window_size     ,				_A     ,				_A							)
  a__  =y.reshape((1, nb_pixels)							)
  return x + 1.0j * y




def       UpperCAmelCase__    (      _A				:			Callable[[Any, numpy.ndarray], numpy.ndarray]     ,				_A				:			Any     ,				_A				:			int     ,				_A				:			numpy.ndarray     ,				_A				:			float | None = None     ,				):





  '''simple docstring'''







  a__  =z_a.astype('''complex64'''							)
  for _ in range(_A							):
    a__  =eval_function(_A     ,				_A							)
    if infinity is not None:
      numpy.nan_to_num(_A     ,				copy=_A     ,				nan=_A							)
      a__  =infinity
  return z_n




def       UpperCAmelCase__    (      _A				:			str     ,				_A				:			Any     ,				_A				:			float     ,				_A				:			numpy.ndarray     ,				):





  '''simple docstring'''







  a__  =(abs(_A							)).transpose()
  a__  =abs_z_final[::-1, :]
  pyplot.matshow(abs_z_final < escape_radius							)
  pyplot.title(F"""Julia set of ${function_label}$, $c={function_params}$"""							)
  pyplot.show()




def       UpperCAmelCase__    (      ):





  '''simple docstring'''







  warnings.filterwarnings(
      '''ignore'''     ,				category=_A     ,				message='''overflow encountered in multiply'''							)
  warnings.filterwarnings(
      '''ignore'''     ,				category=_A     ,				message='''invalid value encountered in multiply'''     ,				)
  warnings.filterwarnings(
      '''ignore'''     ,				category=_A     ,				message='''overflow encountered in absolute'''							)
  warnings.filterwarnings(
      '''ignore'''     ,				category=_A     ,				message='''overflow encountered in exp'''							)


if __name__ == "__main__":
       lowerCamelCase									= prepare_grid(window_size, nb_pixels)

       ignore_overflow_warnings()  # See file header for explanations

       lowerCamelCase									= 24
       lowerCamelCase									= 2 * abs(c_cauliflower) + 1
       lowerCamelCase									= iterate_function(
           eval_quadratic_polynomial,
           c_cauliflower,
           nb_iterations,
           z_a,
           infinity=1.1 * escape_radius,
       )
       show_results('''z^2+c''', c_cauliflower, escape_radius, z_final)

       lowerCamelCase									= 64
       lowerCamelCase									= 2 * abs(c_polynomial_a) + 1
       lowerCamelCase									= iterate_function(
           eval_quadratic_polynomial,
           c_polynomial_a,
           nb_iterations,
           z_a,
           infinity=1.1 * escape_radius,
       )
       show_results('''z^2+c''', c_polynomial_a, escape_radius, z_final)

       lowerCamelCase									= 161
       lowerCamelCase									= 2 * abs(c_polynomial_a) + 1
       lowerCamelCase									= iterate_function(
           eval_quadratic_polynomial,
           c_polynomial_a,
           nb_iterations,
           z_a,
           infinity=1.1 * escape_radius,
       )
       show_results('''z^2+c''', c_polynomial_a, escape_radius, z_final)

       lowerCamelCase									= 12
       lowerCamelCase									= 10000.0
       lowerCamelCase									= iterate_function(
           eval_exponential,
           c_exponential,
           nb_iterations,
           z_a + 2,
           infinity=1.0e10,
       )
       show_results('''e^z+c''', c_exponential, escape_radius, z_final)



# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
lowerCamelCase									= abspath(join(dirname(dirname(dirname(__file__))), '''src'''))
sys.path.insert(1, git_repo_path)


# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='''ignore''', category=FutureWarning)




def       UpperCAmelCase__    (      _A				:			List[Any]							):





  '''simple docstring'''







  from diffusers.utils.testing_utils import pytest_addoption_shared

  pytest_addoption_shared(_A							)




def       UpperCAmelCase__    (      _A				:			int							):





  '''simple docstring'''







  from diffusers.utils.testing_utils import pytest_terminal_summary_main

  a__  =terminalreporter.config.getoption('''--make-reports'''							)
  if make_reports:
    pytest_terminal_summary_main(_A     ,				id=_A							)
