





'''simple docstring'''





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

import numpy
from matplotlib import pyplot

snake_case__      :							List[str]									=  0.25 + 0.0J
snake_case__      :							Union[str, Any]									=  -0.4 + 0.6J
snake_case__      :							Optional[int]									=  -0.1 + 0.651J
snake_case__      :							Dict									=  -2.0
snake_case__      :							int									=  56
snake_case__      :							Optional[Any]									=  2.0
snake_case__      :							Dict									=  666



def _a       (			lowerCamelCase:     str      ,       lowerCamelCase:     List[Any]				)			->		str:







      '''simple docstring'''






      return numpy.exp(UpperCamelCase_				) + c_parameter



def _a       (			lowerCamelCase:     List[Any]      ,       lowerCamelCase:     Tuple				)			->		Optional[Any]:







      '''simple docstring'''






      return z_values * z_values + c_parameter



def _a       (			lowerCamelCase:     Optional[int]      ,       lowerCamelCase:     Tuple				)			->		Any:







      '''simple docstring'''






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



def _a       (			lowerCamelCase:     str      ,       lowerCamelCase:     Any      ,       lowerCamelCase:     Union[str, Any]      ,       lowerCamelCase:     Dict      ,       lowerCamelCase:     Tuple = None      ,       )			->		Dict:







      '''simple docstring'''






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



def _a       (			lowerCamelCase:     Tuple      ,       lowerCamelCase:     Any      ,       lowerCamelCase:     List[str]      ,       lowerCamelCase:     Optional[int]      ,       )			->		int:







      '''simple docstring'''






      __A      =       (abs(UpperCamelCase_				)).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 _a       (			)			->		int:







      '''simple docstring'''






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


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

       ignore_overflow_warnings()  # See file header for explanations

       snake_case__      :							Any									=  24
       snake_case__      :							Dict									=  2 * abs(c_cauliflower) + 1
       snake_case__      :							Optional[Any]									=  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)

       snake_case__      :							List[str]									=  64
       snake_case__      :							Any									=  2 * abs(c_polynomial_a) + 1
       snake_case__      :							List[str]									=  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)

       snake_case__      :							List[Any]									=  161
       snake_case__      :							List[Any]									=  2 * abs(c_polynomial_a) + 1
       snake_case__      :							Dict									=  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)

       snake_case__      :							Optional[Any]									=  12
       snake_case__      :							Dict									=  10_000.0
       snake_case__      :							Tuple									=  iterate_function(
           eval_exponential,
           c_exponential,
           nb_iterations,
           z_a + 2,
           infinity=1.0e1_0,
       )
       show_results('e^z+c', c_exponential, escape_radius, z_final)












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


snake_case__      :							Optional[int]									=  {'configuration_cvt': ['CVT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'CvtConfig']}


try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       snake_case__      :							Union[str, Any]									=  [
           'CVT_PRETRAINED_MODEL_ARCHIVE_LIST',
           'CvtForImageClassification',
           'CvtModel',
           'CvtPreTrainedModel',
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       snake_case__      :							List[str]									=  [
           'TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST',
           'TFCvtForImageClassification',
           'TFCvtModel',
           'TFCvtPreTrainedModel',
       ]

if TYPE_CHECKING:
       from .configuration_cvt import CVT_PRETRAINED_CONFIG_ARCHIVE_MAP, CvtConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_cvt import (
                  CVT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  CvtForImageClassification,
                  CvtModel,
                  CvtPreTrainedModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_cvt import (
                  TF_CVT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFCvtForImageClassification,
                  TFCvtModel,
                  TFCvtPreTrainedModel,
              )


else:
       import sys

       snake_case__      :							Dict									=  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





