



"""simple docstring"""







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






class       UpperCamelCase__			(   _lowerCAmelCase      ):

			"""simple docstring"""


			A__	:					Union[str, Any]							  =     "ClapFeatureExtractor"
			A__	:					str							  =     ("RobertaTokenizer", "RobertaTokenizerFast")


			def __init__(      self						,	SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__		)      ->	Union[str, Any]:
				super().__init__(SCREAMING_SNAKE_CASE__						,	SCREAMING_SNAKE_CASE__		)


			def __call__(      self						,	SCREAMING_SNAKE_CASE__=None						,	SCREAMING_SNAKE_CASE__=None						,	SCREAMING_SNAKE_CASE__=None						,	**SCREAMING_SNAKE_CASE__		)      ->	Union[str, Any]:
				A__											=					kwargs.pop("sampling_rate"						,	SCREAMING_SNAKE_CASE__		)

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

				if text is not None:
					A__											=					self.tokenizer(SCREAMING_SNAKE_CASE__						,	return_tensors=SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)

				if audios is not None:
					A__											=					self.feature_extractor(
					    SCREAMING_SNAKE_CASE__						,	sampling_rate=SCREAMING_SNAKE_CASE__						,	return_tensors=SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)

				if text is not None and audios is not None:
					A__											=					audio_features.input_features
					return encoding
				elif text is not None:
					return encoding
				else:
					return BatchEncoding(data=dict(**SCREAMING_SNAKE_CASE__		)						,	tensor_type=SCREAMING_SNAKE_CASE__		)


			def   snake_case__	(      self						,	*SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)      ->	Optional[Any]:
				return self.tokenizer.batch_decode(*SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)


			def   snake_case__	(      self						,	*SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)      ->	Optional[Any]:
				return self.tokenizer.decode(*SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)







			@property
			def   snake_case__	(      self		)      ->	Any:
				A__											=					self.tokenizer.model_input_names
				A__											=					self.feature_extractor.model_input_names
				return list(dict.fromkeys(tokenizer_input_names + feature_extractor_input_names		)		)









"""simple docstring"""







def       _lowerCamelCase				(							UpperCAmelCase_ :       int     )	-> int:






	"""simple docstring"""





	if not isinstance(UpperCAmelCase_,	UpperCAmelCase_     ):
		raise ValueError("Input must be an integer"     )
	if input_num <= 0:
		raise ValueError("Input must be positive"     )
	return sum(
	    divisor for divisor in range(1,	input_num // 2 + 1     ) if input_num % divisor == 0     )


if __name__ == "__main__":
			import doctest

			doctest.testmod()




