




import warnings

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







class     __lowerCAmelCase (       __magic_name__ ):

			"""simple docstring"""







			snake_case_   		=       ['''image_processor''', '''tokenizer''']
			snake_case_   		=       '''CLIPImageProcessor'''
			snake_case_   		=       ('''CLIPTokenizer''', '''CLIPTokenizerFast''')


			def __init__(      self			,						lowerCamelCase__=None			,						lowerCamelCase__=None			,						**lowerCamelCase__							)    ->      Tuple:



							'''simple docstring'''
							__lowerCamelCase		       =    None
							if "feature_extractor" in kwargs:
											warnings.warn(
											    'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
											    ' instead.'			,						lowerCamelCase__			,						)
											__lowerCamelCase		       =    kwargs.pop('feature_extractor'							)

							__lowerCamelCase		       =    image_processor if image_processor is not None else feature_extractor
							if image_processor is None:
											raise ValueError('You need to specify an `image_processor`.'							)
							if tokenizer is None:
											raise ValueError('You need to specify a `tokenizer`.'							)

							super().__init__(lowerCamelCase__			,						lowerCamelCase__							)


			def __call__(      self			,						lowerCamelCase__=None			,						lowerCamelCase__=None			,						lowerCamelCase__=None			,						**lowerCamelCase__							)    ->      str:



							'''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:
											__lowerCamelCase		       =    self.tokenizer(lowerCamelCase__			,						return_tensors=lowerCamelCase__			,						**lowerCamelCase__							)

							if images is not None:
											__lowerCamelCase		       =    self.image_processor(lowerCamelCase__			,						return_tensors=lowerCamelCase__			,						**lowerCamelCase__							)

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


			def       lowercase_    (      self			,						*lowerCamelCase__			,						**lowerCamelCase__							)    ->      List[Any]:



							'''simple docstring'''
							return self.tokenizer.batch_decode(*lowerCamelCase__			,						**lowerCamelCase__							)


			def       lowercase_    (      self			,						*lowerCamelCase__			,						**lowerCamelCase__							)    ->      int:



							'''simple docstring'''
							return self.tokenizer.decode(*lowerCamelCase__			,						**lowerCamelCase__							)


			@property
			def       lowercase_    (      self							)    ->      Tuple:



							'''simple docstring'''
							__lowerCamelCase		       =    self.tokenizer.model_input_names
							__lowerCamelCase		       =    self.image_processor.model_input_names
							return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names							)							)


			@property
			def       lowercase_    (      self							)    ->      Optional[int]:



							'''simple docstring'''
							warnings.warn(
							    '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'			,						lowerCamelCase__			,						)
							return self.image_processor_class






			@property
			def       lowercase_    (      self							)    ->      List[Any]:



							'''simple docstring'''
							warnings.warn(
							    '`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'			,						lowerCamelCase__			,						)
							return self.image_processor








from math import asin, atan, cos, radians, sin, sqrt, tan

_snake_case										=       6_3_7_8_1_3_7.0
_snake_case										=       6_3_5_6_7_5_2.3_1_4_2_4_5
_snake_case										=       6378137







def 				lowerCAmelCase_	(     snake_case_,snake_case_,snake_case_,snake_case_     ):
      _A							:     Any			=						(AXIS_A - AXIS_B) / AXIS_A
      _A							:     Optional[int]			=						atan((1 - flattening) * tan(radians(snake_case_     )     )     )
      _A							:     List[str]			=						atan((1 - flattening) * tan(radians(snake_case_     )     )     )
      _A							:     Optional[Any]			=						radians(snake_case_     )
      _A							:     str			=						radians(snake_case_     )
      # Equation
      _A							:     Dict			=						sin((phi_a - phi_a) / 2     )
      _A							:     List[str]			=						sin((lambda_a - lambda_a) / 2     )
      # Square both values
      sin_sq_phi *= sin_sq_phi
      sin_sq_lambda *= sin_sq_lambda
      _A							:     Optional[int]			=						sqrt(sin_sq_phi + (cos(snake_case_     ) * cos(snake_case_     ) * sin_sq_lambda)     )
      return 2 * RADIUS * asin(snake_case_     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()

