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


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

UpperCamelCase__     :	List[Any]				=			logging.WARNING







def __UpperCamelCase(   ):
   '''simple docstring'''
   UpperCAmelCase__							:				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 __UpperCamelCase(   ):
   '''simple docstring'''
   return __name__.split('''.'''    )[0]







def __UpperCamelCase(   ):
   '''simple docstring'''
   return logging.getLogger(_get_library_name()    )







def __UpperCamelCase(   ):
   '''simple docstring'''
   # Apply our default configuration to the library root logger.
   UpperCAmelCase__							:				Dict   				=  _get_library_root_logger()
   library_root_logger.setLevel(_get_default_logging_level()    )







def __UpperCamelCase(   ):
   '''simple docstring'''
   UpperCAmelCase__							:				Optional[Any]   				=  _get_library_root_logger()
   library_root_logger.setLevel(logging.NOTSET    )







def __UpperCamelCase(   _A					:				Optional[str] = None    ):
   '''simple docstring'''
   if name is None:
      UpperCAmelCase__							:				List[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'''
   UpperCAmelCase__							:				Optional[int]   				=  False







def __UpperCamelCase(   ):
   '''simple docstring'''
   UpperCAmelCase__							:				Optional[Any]   				=  True


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


class 				_lowercase	:
      '''simple docstring'''


      def __init__(				self					,*lowerCamelCase_					,**lowerCamelCase_							)			->			Union[str, Any]:  # pylint: disable=unused-argument



         '''simple docstring'''



         UpperCAmelCase__							:				List[str]   				=  args[0] if args else None




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



         '''simple docstring'''



         return iter(self._iterator							)




      def __getattr__(				self					,lowerCamelCase_							)			->			Optional[Any]:



         '''simple docstring'''



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

         return empty_fn




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



         '''simple docstring'''



         return self




      def __exit__(				self					,lowerCamelCase_					,lowerCamelCase_					,lowerCamelCase_							)			->			Optional[Any]:



         '''simple docstring'''



         return




UpperCamelCase__     :	Dict				=			True


class 				_lowercase	:
      '''simple docstring'''


      def __call__(				self					,*lowerCamelCase_					,lowerCamelCase_=False					,**lowerCamelCase_							)			->			List[Any]:



         '''simple docstring'''



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




      def 		lowerCAmelCase__					(				self					,*lowerCamelCase_					,**lowerCamelCase_							)			->			Any:



         '''simple docstring'''



         UpperCAmelCase__							:				List[str]   				=  None
         if _tqdm_active:
            return tqdm_lib.tqdm.set_lock(*lowerCamelCase_					,**lowerCamelCase_							)




      def 		lowerCAmelCase__					(				self							)			->			Tuple:



         '''simple docstring'''



         if _tqdm_active:
            return tqdm_lib.tqdm.get_lock()




UpperCamelCase__     :	Optional[Any]				=			_tqdm_cls()







def __UpperCamelCase(   ):
   '''simple docstring'''
   global _tqdm_active
   return bool(_tqdm_active    )







def __UpperCamelCase(   ):
   '''simple docstring'''
   global _tqdm_active
   UpperCAmelCase__							:				List[Any]   				=  True







def __UpperCamelCase(   ):
   '''simple docstring'''
   global _tqdm_active
   UpperCAmelCase__							:				List[str]   				=  False





'''simple docstring'''

from typing import TYPE_CHECKING

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


UpperCamelCase__     :	List[Any]				=			{'configuration_yolos': ['YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP', 'YolosConfig', 'YolosOnnxConfig']}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__     :	int				=			['YolosFeatureExtractor']
  UpperCamelCase__     :	int				=			['YolosImageProcessor']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__     :	int				=			[
      'YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST',
      'YolosForObjectDetection',
      'YolosModel',
      'YolosPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_yolos import YolosFeatureExtractor
    from .image_processing_yolos import YolosImageProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_yolos import (
        YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST,
        YolosForObjectDetection,
        YolosModel,
        YolosPreTrainedModel,
    )


else:
  import sys

  UpperCamelCase__     :	int				=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




