
"""simple docstring"""


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

import numpy
from matplotlib import pyplot

__A					=			0.25 + 0.0J
__A					=			-0.4 + 0.6J
__A					=			-0.1 + 0.651J
__A					=			-2.0
__A					=			56
__A					=			2.0
__A					=			666



def        _lowerCamelCase(__UpperCamelCase       ,					__UpperCamelCase			)							->					numpy.ndarray:
	return numpy.exp(__UpperCamelCase			) + c_parameter



def        _lowerCamelCase(__UpperCamelCase       ,					__UpperCamelCase			)							->					numpy.ndarray:
	return z_values * z_values + c_parameter



def        _lowerCamelCase(__UpperCamelCase       ,					__UpperCamelCase			)							->					numpy.ndarray:
	_lowerCAmelCase								=numpy.linspace(-window_size       ,					__UpperCamelCase       ,					__UpperCamelCase			)
	_lowerCAmelCase								=x.reshape((nb_pixels, 1)			)
	_lowerCAmelCase								=numpy.linspace(-window_size       ,					__UpperCamelCase       ,					__UpperCamelCase			)
	_lowerCAmelCase								=y.reshape((1, nb_pixels)			)
	return x + 1.0j * y



def        _lowerCamelCase(__UpperCamelCase       ,					__UpperCamelCase       ,					__UpperCamelCase       ,					__UpperCamelCase       ,					__UpperCamelCase = None       ,					)							->					numpy.ndarray:
	_lowerCAmelCase								=z_a.astype("""complex64"""			)
	for _ in range(__UpperCamelCase			):
		_lowerCAmelCase								=eval_function(__UpperCamelCase       ,					__UpperCamelCase			)
		if infinity is not None:
			numpy.nan_to_num(__UpperCamelCase       ,					copy=__UpperCamelCase       ,					nan=__UpperCamelCase			)
			_lowerCAmelCase								=infinity
	return z_n



def        _lowerCamelCase(__UpperCamelCase       ,					__UpperCamelCase       ,					__UpperCamelCase       ,					__UpperCamelCase       ,					)							->					None:
	_lowerCAmelCase								=(abs(__UpperCamelCase			)).transpose()
	_lowerCAmelCase								=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        _lowerCamelCase()							->					None:
	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__":
			__A					=			prepare_grid(window_size, nb_pixels)

			ignore_overflow_warnings()  # See file header for explanations

			__A					=			24
			__A					=			2 * abs(c_cauliflower) + 1
			__A					=			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)

			__A					=			64
			__A					=			2 * abs(c_polynomial_a) + 1
			__A					=			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)

			__A					=			161
			__A					=			2 * abs(c_polynomial_a) + 1
			__A					=			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)

			__A					=			12
			__A					=			10_000.0
			__A					=			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, is_vision_available


__A					=			{
    'configuration_donut_swin': ['DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DonutSwinConfig'],
    'processing_donut': ['DonutProcessor'],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__A					=			[
			    'DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'DonutSwinModel',
			    'DonutSwinPreTrainedModel',
			]

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__A					=			['DonutFeatureExtractor']
			__A					=			['DonutImageProcessor']


if TYPE_CHECKING:
			from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
			from .processing_donut import DonutProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_donut_swin import (
						    DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
						    DonutSwinModel,
						    DonutSwinPreTrainedModel,
						)

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_donut import DonutFeatureExtractor
						from .image_processing_donut import DonutImageProcessor

else:
			import sys

			__A					=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



