






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


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

snake_case    				=		logging.WARNING


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		SCREAMING_SNAKE_CASE       :      List[str]							=    os.getenv("DATASETS_VERBOSITY"						,     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 DATASETS_VERBOSITY={env_level_str}, '''
						    F'''has to be one of: { ', '.join(log_levels.keys()				) }'''				)
		return _default_log_level


def   lowerCamelCase__			(     ):

		"""simple docstring"""






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


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		return logging.getLogger(_get_library_name()				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






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


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		SCREAMING_SNAKE_CASE       :      Any							=    _get_library_root_logger()
		library_root_logger.setLevel(logging.NOTSET				)


def   lowerCamelCase__			(     lowercase = None				):

		"""simple docstring"""






		if name is None:
				SCREAMING_SNAKE_CASE       :      Dict							=    _get_library_name()
		return logging.getLogger(snake_case_				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		return _get_library_root_logger().getEffectiveLevel()


def   lowerCamelCase__			(     lowercase				):

		"""simple docstring"""






		_get_library_root_logger().setLevel(snake_case_				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		return set_verbosity(snake_case_				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		return set_verbosity(snake_case_				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		return set_verbosity(snake_case_				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		return set_verbosity(snake_case_				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		SCREAMING_SNAKE_CASE       :      Tuple							=    False


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		SCREAMING_SNAKE_CASE       :      Tuple							=    True


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


class  SCREAMING_SNAKE_CASE			:
					'''simple docstring'''


					def __init__(				self       :	Optional[Any]					, *UpperCAmelCase_       :	Optional[int]					, **UpperCAmelCase_       :	Union[str, Any]      ):  # pylint: disable=unused-argument
							SCREAMING_SNAKE_CASE       :      List[Any]							=    args[0] if args else None


					def __iter__(				self       :	str      ):
							return iter(self._iterator      )


					def __getattr__(				self       :	Optional[Any]					, UpperCAmelCase_       :	str      ):

							def empty_fn(*UpperCAmelCase_       :	Optional[int]					, **UpperCAmelCase_       :	Optional[Any]      ):  # pylint: disable=unused-argument
									return

							return empty_fn


					def __enter__(				self       :	Optional[Any]      ):
							return self






					def __exit__(				self       :	Optional[int]					, UpperCAmelCase_       :	Any					, UpperCAmelCase_       :	Optional[int]					, UpperCAmelCase_       :	List[str]      ):
							return





snake_case    				=		True


class  SCREAMING_SNAKE_CASE			:
					'''simple docstring'''


					def __call__(				self       :	Tuple					, *UpperCAmelCase_       :	str					, UpperCAmelCase_       :	Optional[int]=False					, **UpperCAmelCase_       :	Tuple      ):
							if _tqdm_active and not disable:
									return tqdm_lib.tqdm(*UpperCAmelCase_					, **UpperCAmelCase_      )
							else:
									return EmptyTqdm(*UpperCAmelCase_					, **UpperCAmelCase_      )


					def 				_A       (				self       :	int					, *UpperCAmelCase_       :	Tuple					, **UpperCAmelCase_       :	List[str]      ):
							SCREAMING_SNAKE_CASE       :      List[Any]							=    None
							if _tqdm_active:
									return tqdm_lib.tqdm.set_lock(*UpperCAmelCase_					, **UpperCAmelCase_      )






					def 				_A       (				self       :	List[str]      ):
							if _tqdm_active:
									return tqdm_lib.tqdm.get_lock()





snake_case    				=		_tqdm_cls()


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		global _tqdm_active
		return bool(_tqdm_active				)


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		global _tqdm_active
		SCREAMING_SNAKE_CASE       :      str							=    True


def   lowerCamelCase__			(     ):

		"""simple docstring"""






		global _tqdm_active
		SCREAMING_SNAKE_CASE       :      Any							=    False














from typing import TYPE_CHECKING

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


snake_case    				=		{"""configuration_swin""": ["""SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SwinConfig""", """SwinOnnxConfig"""]}


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   snake_case    				=		[
       """SWIN_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """SwinForImageClassification""",
       """SwinForMaskedImageModeling""",
       """SwinModel""",
       """SwinPreTrainedModel""",
       """SwinBackbone""",
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   snake_case    				=		[
       """TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """TFSwinForImageClassification""",
       """TFSwinForMaskedImageModeling""",
       """TFSwinModel""",
       """TFSwinPreTrainedModel""",
   ]

if TYPE_CHECKING:
   from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_swin import (
          SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
          SwinBackbone,
          SwinForImageClassification,
          SwinForMaskedImageModeling,
          SwinModel,
          SwinPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_swin import (
          TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFSwinForImageClassification,
          TFSwinForMaskedImageModeling,
          TFSwinModel,
          TFSwinPreTrainedModel,
      )

else:
   import sys

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






