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


lowercase_     :   List[Any] 				=				{
    'debug': logging.DEBUG,
    'info': logging.INFO,
    'warning': logging.WARNING,
    'error': logging.ERROR,
    'critical': logging.CRITICAL,
}

lowercase_     :   Optional[Any] 				=				logging.WARNING







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







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







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







def 			A__      (	):
 SCREAMING_SNAKE_CASE__:   Any=      _get_library_root_logger()
 library_root_logger.setLevel(logging.NOTSET      )







def 			A__      (	snake_case_ :		Optional[str] = None      ):
 if name is None:
  SCREAMING_SNAKE_CASE__:   Dict=      _get_library_name()
 return logging.getLogger(snake_case_      )







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







def 			A__      (	snake_case_ :		int      ):
 _get_library_root_logger().setLevel(snake_case_      )







def 			A__      (	):
 return set_verbosity(snake_case_      )







def 			A__      (	):
 return set_verbosity(snake_case_      )







def 			A__      (	):
 return set_verbosity(snake_case_      )







def 			A__      (	):
 return set_verbosity(snake_case_      )







def 			A__      (	):
 SCREAMING_SNAKE_CASE__:   Tuple=      False







def 			A__      (	):
 SCREAMING_SNAKE_CASE__:   Tuple=      True


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






class 		_lowerCamelCase		:
    def __init__(  self , *lowerCAmelCase , **lowerCAmelCase   )       ->					Union[str, Any]:  # pylint: disable=unused-argument
     SCREAMING_SNAKE_CASE__:   List[Any]=      args[0] if args else None
    def __iter__(  self   )       ->					List[Any]:
     return iter(self._iterator   )
    def __getattr__(  self , lowerCAmelCase   )       ->					Tuple:

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

     return empty_fn
    def __enter__(  self   )       ->					List[str]:
     return self



    def __exit__(  self , lowerCAmelCase , lowerCAmelCase , lowerCAmelCase   )       ->					Tuple:
     return
lowercase_     :   List[str] 				=				True






class 		_lowerCamelCase		:
    def __call__(  self , *lowerCAmelCase , lowerCAmelCase=False , **lowerCAmelCase   )       ->					Optional[int]:
     if _tqdm_active and not disable:
      return tqdm_lib.tqdm(*lowerCAmelCase , **lowerCAmelCase   )
     else:
      return EmptyTqdm(*lowerCAmelCase , **lowerCAmelCase   )
    def 						UpperCamelCase_				(  self , *lowerCAmelCase , **lowerCAmelCase   )       ->					Tuple:
     SCREAMING_SNAKE_CASE__:   List[Any]=      None
     if _tqdm_active:
      return tqdm_lib.tqdm.set_lock(*lowerCAmelCase , **lowerCAmelCase   )



    def 						UpperCamelCase_				(  self   )       ->					Optional[Any]:
     if _tqdm_active:
      return tqdm_lib.tqdm.get_lock()
lowercase_     :   Optional[int] 				=				_tqdm_cls()







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







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







def 			A__      (	):
 global _tqdm_active
 SCREAMING_SNAKE_CASE__:   Any=      False


from ..utils import DummyObject, requires_backends






class 		_lowerCamelCase		(   metaclass=UpperCamelCase_    ):
    __a  =      ["torch", "scipy"]
    def __init__(  self , *lowerCAmelCase , **lowerCAmelCase   )       ->					Any:
     requires_backends(self , ['''torch''', '''scipy''']   )
    @classmethod
    def 						UpperCamelCase_				(  cls , *lowerCAmelCase , **lowerCAmelCase   )       ->					List[str]:
     requires_backends(cls , ['''torch''', '''scipy''']   )



    @classmethod
    def 						UpperCamelCase_				(  cls , *lowerCAmelCase , **lowerCAmelCase   )       ->					Tuple:
     requires_backends(cls , ['''torch''', '''scipy''']   )

