



'''simple docstring'''





from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding






class __A      (  lowerCamelCase_						):



 '''simple docstring'''







 __lowerCamelCase   :	Optional[int]										=	["""image_processor""", """tokenizer"""]
 __lowerCamelCase   :	Any										=	"""EfficientNetImageProcessor"""
 __lowerCamelCase   :	Optional[int]										=	("""BertTokenizer""", """BertTokenizerFast""")



 def __init__(self			,       A			,       A	)   ->					Optional[Any]:


      """simple docstring"""



      super().__init__(A			,       A	)



 def __call__(self			,       A=None			,       A=None			,       A="max_length"			,       A=64			,       A=None			,       **A	)   ->					Any:


      """simple docstring"""



      if text is None and images is None:
           raise ValueError('''You have to specify either text or images. Both cannot be none.'''	)

      if text is not None:
           _a     =  self.tokenizer(
               A			,       padding=A			,       max_length=A			,       return_tensors=A			,       **A	)

      if images is not None:
           _a     =  self.image_processor(A			,       return_tensors=A			,       **A	)

      if text is not None and images is not None:
           _a     =  image_features.pixel_values
           return encoding
      elif text is not None:
           return encoding
      else:
           return BatchEncoding(data=dict(**A	)			,       tensor_type=A	)



 def  a__  (self			,       *A			,       **A	)   ->					List[Any]:


      """simple docstring"""



      return self.tokenizer.batch_decode(*A			,       **A	)



 def  a__  (self			,       *A			,       **A	)   ->					int:


      """simple docstring"""



      return self.tokenizer.decode(*A			,       **A	)



 @property
 def  a__  (self	)   ->					Optional[Any]:


      """simple docstring"""



      _a     =  self.tokenizer.model_input_names
      _a     =  self.image_processor.model_input_names
      return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names	)	)








'''simple docstring'''





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

import numpy
from matplotlib import pyplot

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




def lowerCAmelCase  (__A  ,     __A):



     """simple docstring"""



     return numpy.exp(__A) + c_parameter




def lowerCAmelCase  (__A  ,     __A):



     """simple docstring"""



     return z_values * z_values + c_parameter




def lowerCAmelCase  (__A  ,     __A):



     """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 lowerCAmelCase  (__A  ,     __A  ,     __A  ,     __A  ,     __A = 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 lowerCAmelCase  (__A  ,     __A  ,     __A  ,     __A  ,     ):



     """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 lowerCAmelCase  ():



     """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__":
  lowercase_			=  prepare_grid(window_size, nb_pixels)

  ignore_overflow_warnings()  # See file header for explanations

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

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

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

  lowercase_			=  12
  lowercase_			=  1_0000.0
  lowercase_			=  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)



