





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


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

_SCREAMING_SNAKE_CASE					=						logging.WARNING


def 							SCREAMING_SNAKE_CASE__  (      ):
	snake_case_						:     Any     =		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 							SCREAMING_SNAKE_CASE__  (      ):
	return __name__.split('.'				)[0]


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


def 							SCREAMING_SNAKE_CASE__  (      ):
	# Apply our default configuration to the library root logger.
	snake_case_						:     str     =		_get_library_root_logger()
	library_root_logger.setLevel(_get_default_logging_level()				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	snake_case_						:     Optional[Any]     =		_get_library_root_logger()
	library_root_logger.setLevel(logging.NOTSET				)


def 							SCREAMING_SNAKE_CASE__  (      __a = None				):
	if name is None:
		snake_case_						:     List[Any]     =		_get_library_name()
	return logging.getLogger(__a				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	return _get_library_root_logger().getEffectiveLevel()


def 							SCREAMING_SNAKE_CASE__  (      __a				):
	_get_library_root_logger().setLevel(__a				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	return set_verbosity(__a				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	return set_verbosity(__a				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	return set_verbosity(__a				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	return set_verbosity(__a				)


def 							SCREAMING_SNAKE_CASE__  (      ):
	snake_case_						:     Optional[int]     =		False


def 							SCREAMING_SNAKE_CASE__  (      ):
	snake_case_						:     Dict     =		True


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






						def __init__( self : int						,				*_A : str						,				**_A : Dict		)							->      Optional[int]:  # pylint: disable=unused-argument







							"""simple docstring"""


							snake_case_						:     Optional[int]     =		args[0] if args else None






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







							"""simple docstring"""


							return iter(self._iterator		)






						def __getattr__( self : int						,				_A : int		)							->      Tuple:







							"""simple docstring"""


							def empty_fn(*_A : int						,				**_A : Union[str, Any]		):  # pylint: disable=unused-argument
								return

							return empty_fn






						def __enter__( self : Optional[int]		)							->      Optional[int]:







							"""simple docstring"""


							return self






						def __exit__( self : Optional[int]						,				_A : int						,				_A : Any						,				_A : int		)							->      Dict:







							"""simple docstring"""


							return
_SCREAMING_SNAKE_CASE					=						True
class SCREAMING_SNAKE_CASE_  :






						def __call__( self : Optional[Any]						,				*_A : Optional[Any]						,				_A : Tuple=False						,				**_A : Optional[Any]		)							->      Dict:







							"""simple docstring"""


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






						def UpperCAmelCase_			( self : Any						,				*_A : Optional[int]						,				**_A : str		)							->      int:







							"""simple docstring"""


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






						def UpperCAmelCase_			( self : List[Any]		)							->      Dict:







							"""simple docstring"""


							if _tqdm_active:
								return tqdm_lib.tqdm.get_lock()
_SCREAMING_SNAKE_CASE					=						_tqdm_cls()


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


def 							SCREAMING_SNAKE_CASE__  (      ):
	global _tqdm_active
	snake_case_						:     str     =		True


def 							SCREAMING_SNAKE_CASE__  (      ):
	global _tqdm_active
	snake_case_						:     str     =		False








from typing import TYPE_CHECKING

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


_SCREAMING_SNAKE_CASE 		=						{
    """configuration_xlm""": ["""XLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """XLMConfig""", """XLMOnnxConfig"""],
    """tokenization_xlm""": ["""XLMTokenizer"""],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_SCREAMING_SNAKE_CASE 		=						[
						    """XLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """XLMForMultipleChoice""",
						    """XLMForQuestionAnswering""",
						    """XLMForQuestionAnsweringSimple""",
						    """XLMForSequenceClassification""",
						    """XLMForTokenClassification""",
						    """XLMModel""",
						    """XLMPreTrainedModel""",
						    """XLMWithLMHeadModel""",
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_SCREAMING_SNAKE_CASE 		=						[
						    """TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """TFXLMForMultipleChoice""",
						    """TFXLMForQuestionAnsweringSimple""",
						    """TFXLMForSequenceClassification""",
						    """TFXLMForTokenClassification""",
						    """TFXLMMainLayer""",
						    """TFXLMModel""",
						    """TFXLMPreTrainedModel""",
						    """TFXLMWithLMHeadModel""",
						]


if TYPE_CHECKING:
						from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig
						from .tokenization_xlm import XLMTokenizer

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_xlm import (
												    XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
												    XLMForMultipleChoice,
												    XLMForQuestionAnswering,
												    XLMForQuestionAnsweringSimple,
												    XLMForSequenceClassification,
												    XLMForTokenClassification,
												    XLMModel,
												    XLMPreTrainedModel,
												    XLMWithLMHeadModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_xlm import (
												    TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFXLMForMultipleChoice,
												    TFXLMForQuestionAnsweringSimple,
												    TFXLMForSequenceClassification,
												    TFXLMForTokenClassification,
												    TFXLMMainLayer,
												    TFXLMModel,
												    TFXLMPreTrainedModel,
												    TFXLMWithLMHeadModel,
												)

else:
						import sys

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

