

from typing import List

from .keymap import KEYMAP, get_character





def      A__					(			__A  :						str			)					->Dict:

      def decorator(__A  :						Union[str, Any]			):
            __A    =getattr(__A     ,				'''handle_key'''     ,				[]			)
            handle += [key]
            setattr(__A     ,				'''handle_key'''     ,				__A			)
            return func

      return decorator





def      A__					(			*__A  :						List[str]			)					->Optional[int]:

      def decorator(__A  :						int			):
            __A    =getattr(__A     ,				'''handle_key'''     ,				[]			)
            handle += keys
            setattr(__A     ,				'''handle_key'''     ,				__A			)
            return func

      return decorator





class        lowerCAmelCase__  (					__magic_name__			):



       '''simple docstring'''







       def __new__(							cls ,   lowercase__ ,   lowercase__ ,   lowercase__     ):







             '''simple docstring'''



             __A    =super().__new__(cls ,   lowercase__ ,   lowercase__ ,   lowercase__     )
             if not hasattr(lowercase__ ,   '''key_handler'''     ):
                   setattr(lowercase__ ,   '''key_handler''' ,   {}     )
             setattr(lowercase__ ,   '''handle_input''' ,   KeyHandler.handle_input     )

             for value in attrs.values():
                   __A    =getattr(lowercase__ ,   '''handle_key''' ,   []     )
                   for key in handled_keys:
                         __A    =value
             return new_cls


       @staticmethod
       def     __UpperCamelCase     (							cls     ):







             '''simple docstring'''



             __A    =get_character()
             if char != KEYMAP["undefined"]:
                   __A    =ord(lowercase__     )
             __A    =cls.key_handler.get(lowercase__     )
             if handler:
                   __A    =char
                   return handler(cls     )
             else:
                   return None





def      A__					(			cls  :						List[Any]			)					->Union[str, Any]:
      return KeyHandler(cls.__name__     ,				cls.__bases__     ,				cls.__dict__.copy()			)





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


_lowerCamelCase      :					int					    =      {
    '''configuration_audio_spectrogram_transformer''': [
        '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ASTConfig''',
    ]
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase      :					Tuple					    =      [
       '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''ASTForAudioClassification''',
       '''ASTModel''',
       '''ASTPreTrainedModel''',
   ]

try:
   if not is_speech_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase      :					Optional[Any]					    =      ['''ASTFeatureExtractor''']

if TYPE_CHECKING:
   from .configuration_audio_spectrogram_transformer import (
       AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
       ASTConfig,
   )

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_audio_spectrogram_transformer import (
          AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          ASTForAudioClassification,
          ASTModel,
          ASTPreTrainedModel,
      )

   try:
      if not is_speech_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
   import sys

   _lowerCamelCase      :					Optional[int]					    =      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


