


import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin







class     __lowerCamelCase     (  __a     ):


							"""simple docstring"""

							lowerCAmelCase__          =				"AutoFeatureExtractor"
							lowerCAmelCase__          =				"Speech2Text2Tokenizer"




							def __init__(  self						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       Union[str, Any]:






								'''simple docstring'''






								super().__init__(lowerCAmelCase_						,       lowerCAmelCase_  )
								lowercase_			 = self.feature_extractor
								lowercase_			 = False




							def __call__(  self						,       *UpperCAmelCase						,       **UpperCAmelCase  )     ->       List[str]:






								'''simple docstring'''






								if self._in_target_context_manager:
									return self.current_processor(*lowerCAmelCase_						,       **lowerCAmelCase_  )

								if "raw_speech" in kwargs:
									warnings.warn("Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead."  )
									lowercase_			 = kwargs.pop("raw_speech"  )
								else:
									lowercase_			 = kwargs.pop("audio"						,       lowerCAmelCase_  )
								lowercase_			 = kwargs.pop("sampling_rate"						,       lowerCAmelCase_  )
								lowercase_			 = kwargs.pop("text"						,       lowerCAmelCase_  )
								if len(lowerCAmelCase_  ) > 0:
									lowercase_			 = args[0]
									lowercase_			 = 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:
									lowercase_			 = self.feature_extractor(lowerCAmelCase_						,       *lowerCAmelCase_						,       sampling_rate=lowerCAmelCase_						,       **lowerCAmelCase_  )
								if text is not None:
									lowercase_			 = self.tokenizer(lowerCAmelCase_						,       **lowerCAmelCase_  )

								if text is None:
									return inputs
								elif audio is None:
									return encodings
								else:
									lowercase_			 = encodings["input_ids"]
									return inputs




							def 				A__      (  self						,       *UpperCAmelCase						,       **UpperCAmelCase  )     ->       Optional[int]:






								'''simple docstring'''






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




							def 				A__      (  self						,       *UpperCAmelCase						,       **UpperCAmelCase  )     ->       str:






								'''simple docstring'''






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




							@contextmanager
							def 				A__      (  self  )     ->       int:






								'''simple docstring'''






								warnings.warn(
								    "`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your "
								    "labels by using the argument `text` of the regular `__call__` method (either in the same call as "
								    "your audio inputs, or in a separate call."  )
								lowercase_			 = True
								lowercase_			 = self.tokenizer
								yield
								lowercase_			 = self.feature_extractor
								lowercase_			 = False






'''simple docstring'''


lowercase											=      (1, 153, 370, 371, 1_634, 24_678_051, 115_132_219_018_763_992_565_095_597_973_971_522_401)
lowercase											=      (-153, -1, 0, 1.2, 200, "A", [], {}, None)






def 			UpperCAmelCase_							(		lowercase__							):


     '''simple docstring'''







     if not isinstance(lowercase__							,						lowercase__							) or n < 1:
          return False

     # Initialization of sum and number of digits.
     a_									=0
     a_									=0
     a_									=n
     # Calculation of digits of the number
     while temp > 0:
          number_of_digits += 1
          temp //= 1_0
     # Dividing number into separate digits and find Armstrong number
     a_									=n
     while temp > 0:
          a_									=temp % 1_0
          total += rem**number_of_digits
          temp //= 1_0
     return n == total






def 			UpperCAmelCase_							(		lowercase__							):


     '''simple docstring'''







     if not isinstance(lowercase__							,						lowercase__							) or n < 1:
          return False

     # Init a "histogram" of the digits
     a_									=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     a_									=0
     a_									=0
     a_									=n
     while temp > 0:
          a_		,    a_									=divmod(lowercase__							,						1_0							)
          digit_histogram[rem] += 1
          digit_total += 1

     for cnt, i in zip(lowercase__							,						range(len(lowercase__							)							)							):
          total += cnt * i**digit_total

     return n == total






def 			UpperCAmelCase_							(		lowercase__							):


     '''simple docstring'''







     if not isinstance(lowercase__							,						lowercase__							) or n < 1:
          return False
     a_									=len(str(lowercase__							)							)  # the power that all digits will be raised to
     # check if sum of each digit multiplied expo times is equal to number
     return n == sum(int(lowercase__							) ** expo for i in str(lowercase__							)							)






def 			UpperCAmelCase_							(		):


     '''simple docstring'''







     a_									=int(input("Enter an integer to see if it is an Armstrong number: "							).strip()							)
     print(F"""{num} is {'' if armstrong_number(lowercase__							) else 'not '}an Armstrong number."""							)
     print(F"""{num} is {'' if narcissistic_number(lowercase__							) else 'not '}an Armstrong number."""							)
     print(F"""{num} is {'' if pluperfect_number(lowercase__							) else 'not '}an Armstrong number."""							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()


