

import warnings
from contextlib import contextmanager

from ....processing_utils import ProcessorMixin

class    _lowercase				(					__lowerCamelCase			):
   _lowercase     :       Union[str, Any]  					=    'MCTCTFeatureExtractor'
   _lowercase     :       Optional[int]  					=    'AutoTokenizer'

   def __init__(				self	:    Dict			,						lowerCamelCase__	:    Tuple			,						lowerCamelCase__	:    Optional[int]       ) ->			List[Any]:
         """simple docstring"""





         super().__init__(lowerCamelCase__			,						lowerCamelCase__       )
         A_							       =		self.feature_extractor
         A_							       =		False

   def __call__(				self	:    Union[str, Any]			,						*lowerCamelCase__	:    str			,						**lowerCamelCase__	:    List[str]       ) ->			Dict:
         """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.'''       )
               A_							       =		kwargs.pop('''raw_speech'''       )
         else:
               A_							       =		kwargs.pop('''audio'''			,						lowerCamelCase__       )
         A_							       =		kwargs.pop('''sampling_rate'''			,						lowerCamelCase__       )
         A_							       =		kwargs.pop('''text'''			,						lowerCamelCase__       )
         if len(lowerCamelCase__       ) > 0:
               A_							       =		args[0]
               A_							       =		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:
               A_							       =		self.feature_extractor(lowerCamelCase__			,						*lowerCamelCase__			,						sampling_rate=lowerCamelCase__			,						**lowerCamelCase__       )
         if text is not None:
               A_							       =		self.tokenizer(lowerCamelCase__			,						**lowerCamelCase__       )

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

   def     UpperCamelCase					(				self	:    Union[str, Any]			,						*lowerCamelCase__	:    Union[str, Any]			,						**lowerCamelCase__	:    Tuple       ) ->			Any:
         """simple docstring"""





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

   def     UpperCamelCase					(				self	:    Optional[Any]			,						*lowerCamelCase__	:    Any			,						**lowerCamelCase__	:    Optional[int]       ) ->			List[str]:
         """simple docstring"""





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

         A_							       =		kwargs.pop('''input_features'''			,						lowerCamelCase__       )
         A_							       =		kwargs.pop('''labels'''			,						lowerCamelCase__       )
         if len(lowerCamelCase__       ) > 0:
               A_							       =		args[0]
               A_							       =		args[1:]

         if input_features is not None:
               A_							       =		self.feature_extractor.pad(lowerCamelCase__			,						*lowerCamelCase__			,						**lowerCamelCase__       )
         if labels is not None:
               A_							       =		self.tokenizer.pad(lowerCamelCase__			,						**lowerCamelCase__       )

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

   def     UpperCamelCase					(				self	:    Any			,						*lowerCamelCase__	:    Any			,						**lowerCamelCase__	:    Union[str, Any]       ) ->			Optional[Any]:
         """simple docstring"""





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





   @contextmanager
   def     UpperCamelCase					(				self	:    List[str]       ) ->			List[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.'''       )
         A_							       =		True
         A_							       =		self.tokenizer
         yield
         A_							       =		self.feature_extractor
         A_							       =		False








# this script reports modified .py files under the desired list of top-level sub-dirs passed as a list of arguments, e.g.:
#   python ./utils/get_modified_files.py utils src tests examples
#
# it uses git to find the forking point and which files were modified - i.e. files not under git won't be considered
# since the output of this script is fed into Makefile commands it doesn't print a newline after the results

import re
import subprocess
import sys


__lowercase				      =						subprocess.check_output("""git merge-base main HEAD""".split()).decode("""utf-8""")
__lowercase				      =						(
    subprocess.check_output(f'git diff --diff-filter=d --name-only {fork_point_sha}'.split()).decode("""utf-8""").split()
)

__lowercase				      =						"""|""".join(sys.argv[1:])
__lowercase				      =						re.compile(rf'^({joined_dirs}).*?\.py$')

__lowercase				      =						[x for x in modified_files if regex.match(x)]
print(""" """.join(relevant_modified_files), end="""""")





