




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

import huggingface_hub.utils as hf_hub_utils
from tqdm import auto as tqdm_lib


UpperCamelCase__    			=			threading.Lock()
UpperCamelCase__    			=			None

UpperCamelCase__    			=			{
    """debug""": logging.DEBUG,
    """info""": logging.INFO,
    """warning""": logging.WARNING,
    """error""": logging.ERROR,
    """critical""": logging.CRITICAL,
}

UpperCamelCase__    			=			logging.WARNING

UpperCamelCase__    			=			True







def 	_a      (						):
					__lowerCAmelCase				   =       os.getenv("TRANSFORMERS_VERBOSITY"      ,      SCREAMING_SNAKE_CASE_     )
					if env_level_str:
										if env_level_str in log_levels:
															return log_levels[env_level_str]
										else:
															logging.getLogger().warning(
															    F"""Unknown option TRANSFORMERS_VERBOSITY={env_level_str}, """
															    F"""has to be one of: { ', '.join(log_levels.keys()     ) }"""     )
					return _default_log_level







def 	_a      (						):
					return __name__.split("."     )[0]







def 	_a      (						):
					return logging.getLogger(_get_library_name()     )







def 	_a      (						):
					global _default_handler

					with _lock:
										if _default_handler:
															# This library has already configured the library root logger.
															return
										__lowerCAmelCase				   =       logging.StreamHandler()  # Set sys.stderr as stream.
										__lowerCAmelCase				   =       sys.stderr.flush

										# Apply our default configuration to the library root logger.
										__lowerCAmelCase				   =       _get_library_root_logger()
										library_root_logger.addHandler(_default_handler     )
										library_root_logger.setLevel(_get_default_logging_level()     )
										__lowerCAmelCase				   =       False







def 	_a      (						):
					global _default_handler

					with _lock:
										if not _default_handler:
															return

										__lowerCAmelCase				   =       _get_library_root_logger()
										library_root_logger.removeHandler(_default_handler     )
										library_root_logger.setLevel(logging.NOTSET     )
										__lowerCAmelCase				   =       None







def 	_a      (						):
					return log_levels







def 	_a      (						SCREAMING_SNAKE_CASE_							:				Optional[str] = None     ):

					if name is None:
										__lowerCAmelCase				   =       _get_library_name()

					_configure_library_root_logger()
					return logging.getLogger(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					_configure_library_root_logger()
					return _get_library_root_logger().getEffectiveLevel()







def 	_a      (						SCREAMING_SNAKE_CASE_							:				int     ):
					_configure_library_root_logger()
					_get_library_root_logger().setLevel(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					return set_verbosity(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					return set_verbosity(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					return set_verbosity(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					return set_verbosity(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					_configure_library_root_logger()

					assert _default_handler is not None
					_get_library_root_logger().removeHandler(_default_handler     )







def 	_a      (						):
					_configure_library_root_logger()

					assert _default_handler is not None
					_get_library_root_logger().addHandler(_default_handler     )







def 	_a      (						SCREAMING_SNAKE_CASE_							:				logging.Handler     ):
					_configure_library_root_logger()

					assert handler is not None
					_get_library_root_logger().addHandler(SCREAMING_SNAKE_CASE_     )







def 	_a      (						SCREAMING_SNAKE_CASE_							:				logging.Handler     ):
					_configure_library_root_logger()

					assert handler is not None and handler not in _get_library_root_logger().handlers
					_get_library_root_logger().removeHandler(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					_configure_library_root_logger()
					__lowerCAmelCase				   =       False







def 	_a      (						):
					_configure_library_root_logger()
					__lowerCAmelCase				   =       True







def 	_a      (						):
					__lowerCAmelCase				   =       _get_library_root_logger().handlers

					for handler in handlers:
										__lowerCAmelCase				   =       logging.Formatter("[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s"     )
										handler.setFormatter(SCREAMING_SNAKE_CASE_     )







def 	_a      (						):
					__lowerCAmelCase				   =       _get_library_root_logger().handlers

					for handler in handlers:
										handler.setFormatter(SCREAMING_SNAKE_CASE_     )







def 	_a      (						self							:				List[Any]      ,      *SCREAMING_SNAKE_CASE_							:				Optional[int]      ,      **SCREAMING_SNAKE_CASE_							:				int     ):
					__lowerCAmelCase				   =       os.getenv("TRANSFORMERS_NO_ADVISORY_WARNINGS"      ,      SCREAMING_SNAKE_CASE_     )
					if no_advisory_warnings:
										return
					self.warning(*SCREAMING_SNAKE_CASE_      ,      **SCREAMING_SNAKE_CASE_     )


UpperCamelCase__    			=			warning_advice







@functools.lru_cache(SCREAMING_SNAKE_CASE_     )
def 	_a      (						self							:				Tuple      ,      *SCREAMING_SNAKE_CASE_							:				int      ,      **SCREAMING_SNAKE_CASE_							:				Optional[int]     ):
					self.warning(*SCREAMING_SNAKE_CASE_      ,      **SCREAMING_SNAKE_CASE_     )


UpperCamelCase__    			=			warning_once
class 			a__    :






						def __init__(   self		,			*_A		,			**_A			):  # pylint: disable=unused-argument




											"""simple docstring"""



											__lowerCAmelCase				   =       args[0] if args else None






						def __iter__(   self			):




											"""simple docstring"""



											return iter(self._iterator			)






						def __getattr__(   self		,			_A			):




											"""simple docstring"""



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

											return empty_fn






						def __enter__(   self			):




											"""simple docstring"""



											return self






						def __exit__(   self		,			_A		,			_A		,			_A			):




											"""simple docstring"""



											return






class 			a__    :






						def __call__(   self		,			*_A		,			**_A			):




											"""simple docstring"""



											if _tqdm_active:
																return tqdm_lib.tqdm(*_A		,			**_A			)
											else:
																return EmptyTqdm(*_A		,			**_A			)






						def 				__SCREAMING_SNAKE_CASE(   self		,			*_A		,			**_A			):




											"""simple docstring"""



											__lowerCAmelCase				   =       None
											if _tqdm_active:
																return tqdm_lib.tqdm.set_lock(*_A		,			**_A			)






						def 				__SCREAMING_SNAKE_CASE(   self			):




											"""simple docstring"""



											if _tqdm_active:
																return tqdm_lib.tqdm.get_lock()






UpperCamelCase__    			=			_tqdm_cls()







def 	_a      (						):
					global _tqdm_active
					return bool(_tqdm_active     )







def 	_a      (						):
					global _tqdm_active
					__lowerCAmelCase				   =       True
					hf_hub_utils.enable_progress_bars()







def 	_a      (						):
					global _tqdm_active
					__lowerCAmelCase				   =       False
					hf_hub_utils.disable_progress_bars()










from typing import TYPE_CHECKING

from ...utils import _LazyModule


UpperCamelCase__    			=			{"""tokenization_wav2vec2_phoneme""": ["""Wav2Vec2PhonemeCTCTokenizer"""]}


if TYPE_CHECKING:
					from .tokenization_wavaveca_phoneme import WavaVecaPhonemeCTCTokenizer
else:
					import sys

					UpperCamelCase__    			=			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




