"""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


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

SCREAMING_SNAKE_CASE__   =					logging.WARNING





def 				lowerCAmelCase__      (     )   ->			List[Any]:





						"""simple docstring"""






						snake_case        =     os.getenv('DATASETS_VERBOSITY'	,     _UpperCamelCase   )
						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__      (     )   ->			str:





						"""simple docstring"""






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





def 				lowerCAmelCase__      (     )   ->			logging.Logger:





						"""simple docstring"""






						return logging.getLogger(_get_library_name()   )





def 				lowerCAmelCase__      (     )   ->			None:





						"""simple docstring"""






						snake_case        =     _get_library_root_logger()
						library_root_logger.setLevel(_get_default_logging_level()   )





def 				lowerCAmelCase__      (     )   ->			None:





						"""simple docstring"""






						snake_case        =     _get_library_root_logger()
						library_root_logger.setLevel(logging.NOTSET   )





def 				lowerCAmelCase__      (     _UpperCamelCase    :			Optional[str] = None   )   ->			logging.Logger:





						"""simple docstring"""






						if name is None:
												snake_case        =     _get_library_name()
						return logging.getLogger(_UpperCamelCase   )





def 				lowerCAmelCase__      (     )   ->			int:





						"""simple docstring"""






						return _get_library_root_logger().getEffectiveLevel()





def 				lowerCAmelCase__      (     _UpperCamelCase    :			int   )   ->			None:





						"""simple docstring"""






						_get_library_root_logger().setLevel(_UpperCamelCase   )





def 				lowerCAmelCase__      (     )   ->			Any:





						"""simple docstring"""






						return set_verbosity(_UpperCamelCase   )





def 				lowerCAmelCase__      (     )   ->			Optional[Any]:





						"""simple docstring"""






						return set_verbosity(_UpperCamelCase   )





def 				lowerCAmelCase__      (     )   ->			List[str]:





						"""simple docstring"""






						return set_verbosity(_UpperCamelCase   )





def 				lowerCAmelCase__      (     )   ->			Any:





						"""simple docstring"""






						return set_verbosity(_UpperCamelCase   )





def 				lowerCAmelCase__      (     )   ->			None:





						"""simple docstring"""






						snake_case        =     False





def 				lowerCAmelCase__      (     )   ->			None:





						"""simple docstring"""






						snake_case        =     True


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



class 					lowerCAmelCase_      :

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






										"""simple docstring"""

										snake_case        =     args[0] if args else None

				def __iter__(			self      ):






										"""simple docstring"""

										return iter(self._iterator      )

				def __getattr__(			self						,      lowerCAmelCase      ):






										"""simple docstring"""

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

										return empty_fn

				def __enter__(			self      ):






										"""simple docstring"""

										return self

				def __exit__(			self						,      lowerCAmelCase						,      lowerCAmelCase						,      lowerCAmelCase      ):






										"""simple docstring"""

										return





SCREAMING_SNAKE_CASE__   =					True



class 					lowerCAmelCase_      :

				def __call__(			self						,      *lowerCAmelCase						,      lowerCAmelCase=False						,      **lowerCAmelCase      ):






										"""simple docstring"""

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

				def 						snake_case	(			self						,      *lowerCAmelCase						,      **lowerCAmelCase      ):






										"""simple docstring"""

										snake_case        =     None
										if _tqdm_active:
																return tqdm_lib.tqdm.set_lock(*lowerCAmelCase						,      **lowerCAmelCase      )

				def 						snake_case	(			self      ):






										"""simple docstring"""

										if _tqdm_active:
																return tqdm_lib.tqdm.get_lock()





SCREAMING_SNAKE_CASE__   =					_tqdm_cls()





def 				lowerCAmelCase__      (     )   ->			bool:





						"""simple docstring"""






						global _tqdm_active
						return bool(_tqdm_active   )





def 				lowerCAmelCase__      (     )   ->			Optional[Any]:





						"""simple docstring"""






						global _tqdm_active
						snake_case        =     True





def 				lowerCAmelCase__      (     )   ->			Tuple:





						"""simple docstring"""






						global _tqdm_active
						snake_case        =     False



"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE__   =					logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__   =					{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}



class 					lowerCAmelCase_      (     lowerCAmelCase   ):



				"""simple docstring"""
				_lowerCAmelCase       :      Tuple     					=  """swinv2"""

				_lowerCAmelCase       :      Any     					=  {
				    """num_attention_heads""": """num_heads""",
				    """num_hidden_layers""": """num_layers""",
				}

				def __init__(			self						,      lowerCAmelCase=2_24						,      lowerCAmelCase=4						,      lowerCAmelCase=3						,      lowerCAmelCase=96						,      lowerCAmelCase=[2, 2, 6, 2]						,      lowerCAmelCase=[3, 6, 12, 24]						,      lowerCAmelCase=7						,      lowerCAmelCase=4.0						,      lowerCAmelCase=True						,      lowerCAmelCase=0.0						,      lowerCAmelCase=0.0						,      lowerCAmelCase=0.1						,      lowerCAmelCase="gelu"						,      lowerCAmelCase=False						,      lowerCAmelCase=0.02						,      lowerCAmelCase=1E-5						,      lowerCAmelCase=32						,      **lowerCAmelCase						,      ):






										"""simple docstring"""

										super().__init__(**lowerCAmelCase      )

										snake_case        =     image_size
										snake_case        =     patch_size
										snake_case        =     num_channels
										snake_case        =     embed_dim
										snake_case        =     depths
										snake_case        =     len(lowerCAmelCase      )
										snake_case        =     num_heads
										snake_case        =     window_size
										snake_case        =     mlp_ratio
										snake_case        =     qkv_bias
										snake_case        =     hidden_dropout_prob
										snake_case        =     attention_probs_dropout_prob
										snake_case        =     drop_path_rate
										snake_case        =     hidden_act
										snake_case        =     use_absolute_embeddings
										snake_case        =     layer_norm_eps
										snake_case        =     initializer_range
										snake_case        =     encoder_stride
										# we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
										# this indicates the channel dimension after the last stage of the model
										snake_case        =     int(embed_dim * 2 ** (len(lowerCAmelCase      ) - 1)      )
										snake_case        =     (0, 0, 0, 0)


