






"""simple docstring"""
from ...processing_utils import ProcessorMixin







class      UpperCamelCase_			(__A	):
	__magic_name__       =							'''WhisperFeatureExtractor'''
	__magic_name__       =							'''WhisperTokenizer'''





	def __init__( self   :					Optional[int]      ,      lowerCAmelCase_   :					Optional[int]      ,      lowerCAmelCase_   :					Tuple		)		->     str:
				super().__init__(lowerCAmelCase_      ,      lowerCAmelCase_		)
				UpperCAmelCase_	:					Dict     	=   self.feature_extractor
				UpperCAmelCase_	:					List[str]     	=   False





	def 	_SCREAMING_SNAKE_CASE ( self   :					Dict      ,      lowerCAmelCase_   :					int=None      ,      lowerCAmelCase_   :					Optional[int]=None      ,      lowerCAmelCase_   :					List[str]=True		)		->     int:
				return self.tokenizer.get_decoder_prompt_ids(task=lowerCAmelCase_      ,      language=lowerCAmelCase_      ,      no_timestamps=lowerCAmelCase_		)





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

				UpperCAmelCase_	:					Dict     	=   kwargs.pop("audio"      ,      lowerCAmelCase_		)
				UpperCAmelCase_	:					Optional[int]     	=   kwargs.pop("sampling_rate"      ,      lowerCAmelCase_		)
				UpperCAmelCase_	:					str     	=   kwargs.pop("text"      ,      lowerCAmelCase_		)
				if len(lowerCAmelCase_		) > 0:
							UpperCAmelCase_	:					Dict     	=   args[0]
							UpperCAmelCase_	:					Union[str, Any]     	=   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:
							UpperCAmelCase_	:					Optional[int]     	=   self.feature_extractor(lowerCAmelCase_      ,      *lowerCAmelCase_      ,      sampling_rate=lowerCAmelCase_      ,      **lowerCAmelCase_		)
				if text is not None:
							UpperCAmelCase_	:					Tuple     	=   self.tokenizer(lowerCAmelCase_      ,      **lowerCAmelCase_		)

				if text is None:
							return inputs

				elif audio is None:
							return encodings
				else:
							UpperCAmelCase_	:					List[Any]     	=   encodings["input_ids"]
							return inputs





	def 	_SCREAMING_SNAKE_CASE ( self   :					Tuple      ,      *lowerCAmelCase_   :					Dict      ,      **lowerCAmelCase_   :					List[str]		)		->     Optional[int]:
				return self.tokenizer.batch_decode(*lowerCAmelCase_      ,      **lowerCAmelCase_		)





	def 	_SCREAMING_SNAKE_CASE ( self   :					Optional[int]      ,      *lowerCAmelCase_   :					List[str]      ,      **lowerCAmelCase_   :					Optional[int]		)		->     Union[str, Any]:
				return self.tokenizer.decode(*lowerCAmelCase_      ,      **lowerCAmelCase_		)





	def 	_SCREAMING_SNAKE_CASE ( self   :					Tuple      ,      lowerCAmelCase_   :					str      ,      lowerCAmelCase_   :					Optional[Any]="np"		)		->     Dict:
				return self.tokenizer.get_prompt_ids(lowerCAmelCase_      ,      return_tensors=lowerCAmelCase_		)







def 	_lowerCAmelCase					( UpperCamelCase__:  str				,       UpperCamelCase__:  int				,       UpperCamelCase__:  Any=False    )			-> str:





	"""simple docstring"""







	if isinstance(UpperCamelCase__				,       UpperCamelCase__    ) and isinstance(UpperCamelCase__				,       UpperCamelCase__    ):
		A             =					len(set_a.intersection(UpperCamelCase__    )    )

		if alternative_union:
			A             =					len(UpperCamelCase__    ) + len(UpperCamelCase__    )
		else:
			A             =					len(set_a.union(UpperCamelCase__    )    )

		return intersection / union

	if isinstance(UpperCamelCase__				,       (list, tuple)    ) and isinstance(UpperCamelCase__				,       (list, tuple)    ):
		A             =					[element for element in set_a if element in set_b]

		if alternative_union:
			A             =					len(UpperCamelCase__    ) + len(UpperCamelCase__    )
			return len(UpperCamelCase__    ) / union
		else:
			A             =					set_a + [element for element in set_b if element not in set_a]
			return len(UpperCamelCase__    ) / len(UpperCamelCase__    )

		return len(UpperCamelCase__    ) / len(UpperCamelCase__    )
	return None


if __name__ == "__main__":
				_lowercase							:   List[Any]						=						{"a", "b", "c", "d", "e"}
				_lowercase							:   List[Any]						=						{"c", "d", "e", "f", "h", "i"}
				print(jaccard_similarity(set_a, set_b))



