





"""simple docstring"""





import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin




class 							snake_case							(			__UpperCAmelCase ):

      '''simple docstring'''



      _A     :       List[str]         =       'MCTCTFeatureExtractor'
      _A     :       Union[str, Any]         =       'AutoTokenizer'

      def __init__(							self       :      List[Any]						,				__lowercase       :      Union[str, Any]						,				__lowercase       :      Tuple ):


        '''simple docstring'''




        super().__init__(__lowercase						,				__lowercase )
        __UpperCAmelCase    :						List[str]       =						self.feature_extractor
        __UpperCAmelCase    :						Tuple       =						False

      def __call__(							self       :      List[Any]						,				*__lowercase       :      Any						,				**__lowercase       :      int ):


        '''simple docstring'''




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

        if "raw_speech" in kwargs:
          warnings.warn('''Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.''' )
          __UpperCAmelCase    :						Tuple       =						kwargs.pop('''raw_speech''' )
        else:
          __UpperCAmelCase    :						Tuple       =						kwargs.pop('''audio'''						,				__lowercase )
        __UpperCAmelCase    :						List[Any]       =						kwargs.pop('''sampling_rate'''						,				__lowercase )
        __UpperCAmelCase    :						Union[str, Any]       =						kwargs.pop('''text'''						,				__lowercase )
        if len(__lowercase ) > 0:
          __UpperCAmelCase    :						Optional[int]       =						args[0]
          __UpperCAmelCase    :						Tuple       =						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    :						str       =						self.feature_extractor(__lowercase						,				*__lowercase						,				sampling_rate=__lowercase						,				**__lowercase )
        if text is not None:
          __UpperCAmelCase    :						Dict       =						self.tokenizer(__lowercase						,				**__lowercase )

        if text is None:
          return inputs
        elif audio is None:
          return encodings
        else:
          __UpperCAmelCase    :						Optional[Any]       =						encodings['''input_ids''']
          return inputs

      def       A_					(							self       :      List[str]						,				*__lowercase       :      int						,				**__lowercase       :      Optional[int] ):


        '''simple docstring'''




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

      def       A_					(							self       :      str						,				*__lowercase       :      List[str]						,				**__lowercase       :      List[Any] ):


        '''simple docstring'''




        if self._in_target_context_manager:
          return self.current_processor.pad(*__lowercase						,				**__lowercase )

        __UpperCAmelCase    :						Any       =						kwargs.pop('''input_features'''						,				__lowercase )
        __UpperCAmelCase    :						Optional[Any]       =						kwargs.pop('''labels'''						,				__lowercase )
        if len(__lowercase ) > 0:
          __UpperCAmelCase    :						Optional[Any]       =						args[0]
          __UpperCAmelCase    :						Any       =						args[1:]

        if input_features is not None:
          __UpperCAmelCase    :						List[Any]       =						self.feature_extractor.pad(__lowercase						,				*__lowercase						,				**__lowercase )
        if labels is not None:
          __UpperCAmelCase    :						Optional[Any]       =						self.tokenizer.pad(__lowercase						,				**__lowercase )

        if labels is None:
          return input_features
        elif input_features is None:
          return labels
        else:
          __UpperCAmelCase    :						Dict       =						labels['''input_ids''']
          return input_features

      def       A_					(							self       :      int						,				*__lowercase       :      List[Any]						,				**__lowercase       :      Union[str, Any] ):


        '''simple docstring'''




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







      @contextmanager
      def       A_					(							self       :      Any ):


        '''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.''' )
        __UpperCAmelCase    :						Dict       =						True
        __UpperCAmelCase    :						Tuple       =						self.tokenizer
        yield
        __UpperCAmelCase    :						Optional[int]       =						self.feature_extractor
        __UpperCAmelCase    :						Tuple       =						False






"""simple docstring"""





def       lowerCamelCase_       (   UpperCAmelCase_  )						->float:





  """simple docstring"""


  return 10 - x * x


def       lowerCamelCase_       (   UpperCAmelCase_  ,			UpperCAmelCase_  )						->float:





  """simple docstring"""


  if equation(UpperCAmelCase_  ) * equation(UpperCAmelCase_  ) >= 0:
    raise ValueError('''Wrong space!'''  )

  __UpperCAmelCase    :						Tuple       =						a
  while (b - a) >= 0.01:
    # Find middle point
    __UpperCAmelCase    :						List[str]       =						(a + b) / 2
    # Check if middle point is root
    if equation(UpperCAmelCase_  ) == 0.0:
      break
    # Decide the side to repeat the steps
    if equation(UpperCAmelCase_  ) * equation(UpperCAmelCase_  ) < 0:
      __UpperCAmelCase    :						Union[str, Any]       =						c
    else:
      __UpperCAmelCase    :						str       =						c
  return c


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(bisection(-2, 5))
  print(bisection(0, 6))