


'''simple docstring'''




from sklearn.metrics import accuracy_score

import datasets


_a      :      Dict       				=      """
Accuracy is the proportion of correct predictions among the total number of cases processed. It can be computed with:
Accuracy = (TP + TN) / (TP + TN + FP + FN)
 Where:
TP: True positive
TN: True negative
FP: False positive
FN: False negative
"""


_a      :      List[str]       				=      """
Args:
    predictions (`list` of `int`): Predicted labels.
    references (`list` of `int`): Ground truth labels.
    normalize (`boolean`): If set to False, returns the number of correctly classified samples. Otherwise, returns the fraction of correctly classified samples. Defaults to True.
    sample_weight (`list` of `float`): Sample weights Defaults to None.

Returns:
    accuracy (`float` or `int`): Accuracy score. Minimum possible value is 0. Maximum possible value is 1.0, or the number of examples input, if `normalize` is set to `True`.. A higher score means higher accuracy.

Examples:

    Example 1-A simple example
        >>> accuracy_metric = datasets.load_metric(\"accuracy\")
        >>> results = accuracy_metric.compute(references=[0, 1, 2, 0, 1, 2], predictions=[0, 1, 1, 2, 1, 0])
        >>> print(results)
        {'accuracy': 0.5}

    Example 2-The same as Example 1, except with `normalize` set to `False`.
        >>> accuracy_metric = datasets.load_metric(\"accuracy\")
        >>> results = accuracy_metric.compute(references=[0, 1, 2, 0, 1, 2], predictions=[0, 1, 1, 2, 1, 0], normalize=False)
        >>> print(results)
        {'accuracy': 3.0}

    Example 3-The same as Example 1, except with `sample_weight` set.
        >>> accuracy_metric = datasets.load_metric(\"accuracy\")
        >>> results = accuracy_metric.compute(references=[0, 1, 2, 0, 1, 2], predictions=[0, 1, 1, 2, 1, 0], sample_weight=[0.5, 2, 0.7, 0.5, 9, 0.4])
        >>> print(results)
        {'accuracy': 0.8778625954198473}
"""


_a      :      str       				=      """
@article{scikit-learn,
  title={Scikit-learn: Machine Learning in {P}ython},
  author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V.
         and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P.
         and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and
         Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},
  journal={Journal of Machine Learning Research},
  volume={12},
  pages={2825--2830},
  year={2011}
}
"""




@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION	,				_KWARGS_DESCRIPTION       )
class  _lowercase   (  datasets.Metric       ):
			def a     (	self					:			Any			)   ->       str:
								return datasets.MetricInfo(
								    description=_DESCRIPTION					,      citation=_CITATION					,      inputs_description=_KWARGS_DESCRIPTION					,      features=datasets.Features(
								        {
								            'predictions': datasets.Sequence(datasets.Value('int32'			)			),
								            'references': datasets.Sequence(datasets.Value('int32'			)			),
								        }
								        if self.config_name == 'multilabel'
								        else {
								            'predictions': datasets.Value('int32'			),
								            'references': datasets.Value('int32'			),
								        }			)					,      reference_urls=['https://scikit-learn.org/stable/modules/generated/sklearn.metrics.accuracy_score.html']					,      )





			def a     (	self					:			Dict					,      SCREAMING_SNAKE_CASE_					:			Optional[int]					,      SCREAMING_SNAKE_CASE_					:			Optional[int]					,      SCREAMING_SNAKE_CASE_					:			Tuple=True					,      SCREAMING_SNAKE_CASE_					:			List[str]=None			)   ->       Dict:
								return {
								    "accuracy": float(
								        accuracy_score(SCREAMING_SNAKE_CASE_					,      SCREAMING_SNAKE_CASE_					,      normalize=SCREAMING_SNAKE_CASE_					,      sample_weight=SCREAMING_SNAKE_CASE_			)			)
								}








'''simple docstring'''




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

import numpy
from matplotlib import pyplot

_a      :      Optional[int]       				=      0.25 + 0.0J
_a      :      Dict       				=      -0.4 + 0.6J
_a      :      List[str]       				=      -0.1 + 0.651J
_a      :      Optional[int]       				=      -2.0
_a      :      List[str]       				=      56
_a      :      Tuple       				=      2.0
_a      :      List[str]       				=      666





def      _a		(lowercase__ :      complex       ,      lowercase__ :      numpy.ndarray	) -> numpy.ndarray:






     """simple docstring"""
     return numpy.exp(lowercase__	) + c_parameter





def      _a		(lowercase__ :      complex       ,      lowercase__ :      numpy.ndarray	) -> numpy.ndarray:






     """simple docstring"""
     return z_values * z_values + c_parameter





def      _a		(lowercase__ :      float       ,      lowercase__ :      int	) -> numpy.ndarray:






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





def      _a		(lowercase__ :      Callable[[Any, numpy.ndarray], numpy.ndarray]       ,      lowercase__ :      Any       ,      lowercase__ :      int       ,      lowercase__ :      numpy.ndarray       ,      lowercase__ :      float | None = None       ,      ) -> numpy.ndarray:






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





def      _a		(lowercase__ :      str       ,      lowercase__ :      Any       ,      lowercase__ :      float       ,      lowercase__ :      numpy.ndarray       ,      ) -> None:






     """simple docstring"""
     __snake_case    			=	(abs(lowercase__	)).transpose()
     __snake_case    			=	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		() -> None:






     """simple docstring"""
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='overflow encountered in multiply'	)
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='invalid value encountered in multiply'       ,      )
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='overflow encountered in absolute'	)
     warnings.filterwarnings(
         'ignore'       ,      category=lowercase__       ,      message='overflow encountered in exp'	)


if __name__ == "__main__":
       _a      :      List[Any]       				=      prepare_grid(window_size, nb_pixels)

       ignore_overflow_warnings()  # See file header for explanations

       _a      :      Optional[Any]       				=      24
       _a      :      Optional[int]       				=      2 * abs(c_cauliflower) + 1
       _a      :      List[str]       				=      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      :      str       				=      64
       _a      :      Tuple       				=      2 * abs(c_polynomial_a) + 1
       _a      :      List[Any]       				=      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      :      List[Any]       				=      161
       _a      :      Tuple       				=      2 * abs(c_polynomial_a) + 1
       _a      :      int       				=      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      :      str       				=      12
       _a      :      Optional[Any]       				=      10_000.0
       _a      :      Dict       				=      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)




