


'''simple docstring'''






import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


__A   :    Optional[int]											= {
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

__A   :    int											= logging.WARNING







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  lowerCAmelCase_     : Tuple     =  os.getenv("""DATASETS_VERBOSITY"""				,       A__   )
  if env_level_str:
    if env_level_str in log_levels:
      return log_levels[env_level_str]
    else:
      logging.getLogger().warning(
          f'Unknown option DATASETS_VERBOSITY={env_level_str}, '
          f'has to be one of: { ", ".join(log_levels.keys()   ) }'   )
  return _default_log_level







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return __name__.split("""."""   )[0]







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return logging.getLogger(_get_library_name()   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  lowerCAmelCase_     : str     =  _get_library_root_logger()
  library_root_logger.setLevel(_get_default_logging_level()   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  lowerCAmelCase_     : str     =  _get_library_root_logger()
  library_root_logger.setLevel(logging.NOTSET   )







def 							UpperCamelCase_     (       A__   :  Optional[str] = None   ):
  '''simple docstring'''





  if name is None:
    lowerCAmelCase_     : Optional[Any]     =  _get_library_name()
  return logging.getLogger(A__   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return _get_library_root_logger().getEffectiveLevel()







def 							UpperCamelCase_     (       A__   :  int   ):
  '''simple docstring'''





  _get_library_root_logger().setLevel(A__   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return set_verbosity(A__   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return set_verbosity(A__   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return set_verbosity(A__   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  return set_verbosity(A__   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  lowerCAmelCase_     : Dict     =  False







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  lowerCAmelCase_     : Tuple     =  True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()






class   __snake_case			:







    """simple docstring"""



    def __init__(  self       :    List[Any]       ,		*lowerCamelCase       :    Tuple       ,		**lowerCamelCase       :    Optional[Any]						)  ->    Optional[Any]:  # pylint: disable=unused-argument
      lowerCAmelCase_     : int     =  args[0] if args else None

    def __iter__(  self       :    List[str]						)  ->    Dict:
      return iter(self._iterator						)

    def __getattr__(  self       :    Any       ,		lowerCamelCase       :    List[str]						)  ->    Optional[Any]:

      def empty_fn(*lowerCamelCase       :    Dict       ,		**lowerCamelCase       :    Dict						):  # pylint: disable=unused-argument
        return

      return empty_fn

    def __enter__(  self       :    str						)  ->    List[Any]:
      return self





    def __exit__(  self       :    Tuple       ,		lowerCamelCase       :    List[str]       ,		lowerCamelCase       :    List[Any]       ,		lowerCamelCase       :    Any						)  ->    Optional[int]:
      return







__A   :    Any											= True






class   __snake_case			:







    """simple docstring"""



    def __call__(  self       :    Tuple       ,		*lowerCamelCase       :    int       ,		lowerCamelCase       :    Dict=False       ,		**lowerCamelCase       :    str						)  ->    List[Any]:
      if _tqdm_active and not disable:
        return tqdm_lib.tqdm(*lowerCamelCase       ,		**lowerCamelCase						)
      else:
        return EmptyTqdm(*lowerCamelCase       ,		**lowerCamelCase						)

    def __lowercase  (  self       :    Any       ,		*lowerCamelCase       :    Dict       ,		**lowerCamelCase       :    List[str]						)  ->    List[str]:
      lowerCAmelCase_     : List[str]     =  None
      if _tqdm_active:
        return tqdm_lib.tqdm.set_lock(*lowerCamelCase       ,		**lowerCamelCase						)





    def __lowercase  (  self       :    Optional[Any]						)  ->    List[str]:
      if _tqdm_active:
        return tqdm_lib.tqdm.get_lock()







__A   :    List[Any]											= _tqdm_cls()







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  global _tqdm_active
  return bool(_tqdm_active   )







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  global _tqdm_active
  lowerCAmelCase_     : int     =  True







def 							UpperCamelCase_     (       ):
  '''simple docstring'''





  global _tqdm_active
  lowerCAmelCase_     : Optional[int]     =  False







'''simple docstring'''






from typing import TYPE_CHECKING

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


__A   :    str											= {
    "configuration_audio_spectrogram_transformer": [
        "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ASTConfig",
    ]
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A   :    List[str]											= [
      "AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
      "ASTForAudioClassification",
      "ASTModel",
      "ASTPreTrainedModel",
  ]

try:
  if not is_speech_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A   :    Union[str, 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

  __A   :    List[Any]											= _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



