


'''simple docstring'''

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

import numpy
from matplotlib import pyplot

lowerCamelCase							:       Optional[Any]  						=     0.2_5 + 0.0j
lowerCamelCase							:       Optional[int]  						=     -0.4 + 0.6j
lowerCamelCase							:       Any  						=     -0.1 + 0.651j
lowerCamelCase							:       Optional[Any]  						=     -2.0
lowerCamelCase							:       Optional[int]  						=     56
lowerCamelCase							:       Optional[Any]  						=     2.0
lowerCamelCase							:       Optional[int]  						=     666

def _SCREAMING_SNAKE_CASE				(A  ,			A	)	->	numpy.ndarray:






       """simple docstring"""







       return numpy.exp(A	) + c_parameter

def _SCREAMING_SNAKE_CASE				(A  ,			A	)	->	numpy.ndarray:






       """simple docstring"""







       return z_values * z_values + c_parameter

def _SCREAMING_SNAKE_CASE				(A  ,			A	)	->	numpy.ndarray:






       """simple docstring"""







       lowercase__				      =			numpy.linspace(-window_size  ,			A  ,			A	)
       lowercase__				      =			x.reshape((nb_pixels, 1)	)
       lowercase__				      =			numpy.linspace(-window_size  ,			A  ,			A	)
       lowercase__				      =			y.reshape((1, nb_pixels)	)
       return x + 1.0J * y

def _SCREAMING_SNAKE_CASE				(A  ,			A  ,			A  ,			A  ,			A = None  ,			)	->	numpy.ndarray:






       """simple docstring"""







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

def _SCREAMING_SNAKE_CASE				(A  ,			A  ,			A  ,			A  ,			)	->	None:






       """simple docstring"""







       lowercase__				      =			(abs(A	)).transpose()
       lowercase__				      =			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 _SCREAMING_SNAKE_CASE				()	->	None:






       """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							:       Optional[int]  						=     prepare_grid(window_size, nb_pixels)

 ignore_overflow_warnings()  # See file header for explanations

 lowerCamelCase							:       List[str]  						=     24
 lowerCamelCase							:       Dict  						=     2 * abs(c_cauliflower) + 1
 lowerCamelCase							:       List[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)

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

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

 lowerCamelCase							:       Union[str, Any]  						=     12
 lowerCamelCase							:       Tuple  						=     1_0_0_0_0.0
 lowerCamelCase							:       List[Any]  						=     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)








'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCamelCase							:       str  						=     {'configuration_nat': ['NAT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'NatConfig']}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase							:       Tuple  						=     [
     'NAT_PRETRAINED_MODEL_ARCHIVE_LIST',
     'NatForImageClassification',
     'NatModel',
     'NatPreTrainedModel',
     'NatBackbone',
 ]

if TYPE_CHECKING:
 from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_nat import (
      NAT_PRETRAINED_MODEL_ARCHIVE_LIST,
      NatBackbone,
      NatForImageClassification,
      NatModel,
      NatPreTrainedModel,
  )

else:
 import sys

 lowerCamelCase							:       Optional[Any]  						=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




