



"""simple docstring"""






from ...processing_utils import ProcessorMixin

class  __SCREAMING_SNAKE_CASE			(   lowerCAmelCase_     ):


					'''simple docstring'''





					_a         =							'WhisperFeatureExtractor'
					_a         =							'WhisperTokenizer'



					def __init__( self							:						List[str],						lowerCamelCase							:						Any,						lowerCamelCase							:						Any  )->      str:
								super().__init__(lowerCamelCase,						lowerCamelCase  )
								lowerCamelCase__	:	Dict				=self.feature_extractor
								lowerCamelCase__	:	List[Any]				=False



					def 	snake_case ( self							:						Tuple,						lowerCamelCase							:						Any=None,						lowerCamelCase							:						Any=None,						lowerCamelCase							:						List[str]=True  )->      Dict:
								return self.tokenizer.get_decoder_prompt_ids(task=lowerCamelCase,						language=lowerCamelCase,						no_timestamps=lowerCamelCase  )



					def __call__( self							:						str,						*lowerCamelCase							:						Any,						**lowerCamelCase							:						Union[str, Any]  )->      Dict:
								# For backward compatibility
								if self._in_target_context_manager:
											return self.current_processor(*lowerCamelCase,						**lowerCamelCase  )

								lowerCamelCase__	:	Optional[int]				=kwargs.pop('''audio''',						lowerCamelCase  )
								lowerCamelCase__	:	List[Any]				=kwargs.pop('''sampling_rate''',						lowerCamelCase  )
								lowerCamelCase__	:	List[Any]				=kwargs.pop('''text''',						lowerCamelCase  )
								if len(lowerCamelCase  ) > 0:
											lowerCamelCase__	:	List[str]				=args[0]
											lowerCamelCase__	:	List[str]				=args[1:]

								if audio is None and text is None:
											raise ValueError('''You need to specify either an `audio` or `text` input to process.'''  )

								if audio is not None:
											lowerCamelCase__	:	Dict				=self.feature_extractor(lowerCamelCase,						*lowerCamelCase,						sampling_rate=lowerCamelCase,						**lowerCamelCase  )
								if text is not None:
											lowerCamelCase__	:	Union[str, Any]				=self.tokenizer(lowerCamelCase,						**lowerCamelCase  )

								if text is None:
											return inputs

								elif audio is None:
											return encodings
								else:
											lowerCamelCase__	:	Dict				=encodings['''input_ids''']
											return inputs



					def 	snake_case ( self							:						List[Any],						*lowerCamelCase							:						Optional[Any],						**lowerCamelCase							:						Union[str, Any]  )->      Dict:
								return self.tokenizer.batch_decode(*lowerCamelCase,						**lowerCamelCase  )



					def 	snake_case ( self							:						Dict,						*lowerCamelCase							:						Tuple,						**lowerCamelCase							:						str  )->      str:
								return self.tokenizer.decode(*lowerCamelCase,						**lowerCamelCase  )




					def 	snake_case ( self							:						Optional[Any],						lowerCamelCase							:						str,						lowerCamelCase							:						List[Any]="np"  )->      Tuple:
								return self.tokenizer.get_prompt_ids(lowerCamelCase,						return_tensors=lowerCamelCase  )









"""simple docstring"""






import colorsys

from PIL import Image  # type: ignore






def   snake_case__     (	__lowerCamelCase       :					float							,	__lowerCamelCase       :					float							,	__lowerCamelCase       :					int			):
			"""simple docstring"""
			lowerCamelCase__	:	Optional[Any]				=x
			lowerCamelCase__	:	Any				=y
			for step in range(__lowerCamelCase			):  # noqa: B007
						lowerCamelCase__	:	List[Any]				=a * a - b * b + x
						lowerCamelCase__	:	Optional[int]				=2 * a * b + y
						lowerCamelCase__	:	Union[str, Any]				=a_new

						# divergence happens for all complex number with an absolute value
						# greater than 4
						if a * a + b * b > 4:
									break
			return step / (max_step - 1)






def   snake_case__     (	__lowerCamelCase       :					float			):
			"""simple docstring"""
			if distance == 1:
						return (0, 0, 0)
			else:
						return (255, 255, 255)






def   snake_case__     (	__lowerCamelCase       :					float			):
			"""simple docstring"""
			if distance == 1:
						return (0, 0, 0)
			else:
						return tuple(round(i * 255			) for i in colorsys.hsv_to_rgb(__lowerCamelCase							,	1							,	1			)			)






def   snake_case__     (	__lowerCamelCase       :					int = 800							,	__lowerCamelCase       :					int = 600							,	__lowerCamelCase       :					float = -0.6							,	__lowerCamelCase       :					float = 0							,	__lowerCamelCase       :					float = 3.2							,	__lowerCamelCase       :					int = 50							,	__lowerCamelCase       :					bool = True							,	):
			"""simple docstring"""
			lowerCamelCase__	:	Optional[Any]				=Image.new('''RGB'''							,	(image_width, image_height)			)
			lowerCamelCase__	:	Optional[int]				=img.load()

			# loop through the image-coordinates
			for image_x in range(__lowerCamelCase			):
						for image_y in range(__lowerCamelCase			):
									# determine the figure-coordinates based on the image-coordinates
									lowerCamelCase__	:	Optional[Any]				=figure_width / image_width * image_height
									lowerCamelCase__	:	Dict				=figure_center_x + (image_x / image_width - 0.5) * figure_width
									lowerCamelCase__	:	Optional[int]				=figure_center_y + (image_y / image_height - 0.5) * figure_height

									lowerCamelCase__	:	Any				=get_distance(__lowerCamelCase							,	__lowerCamelCase							,	__lowerCamelCase			)

									# color the corresponding pixel based on the selected coloring-function
									if use_distance_color_coding:
												lowerCamelCase__	:	int				=get_color_coded_rgb(__lowerCamelCase			)
									else:
												lowerCamelCase__	:	Optional[int]				=get_black_and_white_rgb(__lowerCamelCase			)

			return img


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		# colored version, full figure
		_lowercase				:				Optional[Any]   		=		get_image()

		# uncomment for colored version, different section, zoomed in
		# img = get_image(figure_center_x = -0.6, figure_center_y = -0.4,
		# figure_width = 0.8)

		# uncomment for black and white version, full figure
		# img = get_image(use_distance_color_coding = False)

		# uncomment to save the image
		# img.save("mandelbrot.png")

		img.show()




