






"""simple docstring"""

import functools
import logging
import os
import sys
import threading
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

import huggingface_hub.utils as hf_hub_utils
from tqdm import auto as tqdm_lib


lowercase    			=       threading.Lock()
lowercase    			=       None

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

lowercase    			=       logging.WARNING

lowercase    			=       True






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     os.getenv("TRANSFORMERS_VERBOSITY" ,						__lowerCamelCase   )
						if env_level_str:
												if env_level_str in log_levels:
																		return log_levels[env_level_str]
												else:
																		logging.getLogger().warning(
																		    f'''Unknown option TRANSFORMERS_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'''






						global _default_handler

						with _lock:
												if _default_handler:
																		# This library has already configured the library root logger.
																		return
												__magic_name__            =     logging.StreamHandler()  # Set sys.stderr as stream.
												__magic_name__            =     sys.stderr.flush

												# Apply our default configuration to the library root logger.
												__magic_name__            =     _get_library_root_logger()
												library_root_logger.addHandler(_default_handler   )
												library_root_logger.setLevel(_get_default_logging_level()   )
												__magic_name__            =     False






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _default_handler

						with _lock:
												if not _default_handler:
																		return

												__magic_name__            =     _get_library_root_logger()
												library_root_logger.removeHandler(_default_handler   )
												library_root_logger.setLevel(logging.NOTSET   )
												__magic_name__            =     None






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return log_levels






def _lowerCAmelCase	(  __lowerCamelCase:Optional[str] = None   ):

						'''simple docstring'''






						if name is None:
												__magic_name__            =     _get_library_name()

						_configure_library_root_logger()
						return logging.getLogger(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						_configure_library_root_logger()
						return _get_library_root_logger().getEffectiveLevel()






def _lowerCAmelCase	(  __lowerCamelCase:int   ):

						'''simple docstring'''






						_configure_library_root_logger()
						_get_library_root_logger().setLevel(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						return set_verbosity(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						_configure_library_root_logger()

						assert _default_handler is not None
						_get_library_root_logger().removeHandler(_default_handler   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						_configure_library_root_logger()

						assert _default_handler is not None
						_get_library_root_logger().addHandler(_default_handler   )






def _lowerCAmelCase	(  __lowerCamelCase:logging.Handler   ):

						'''simple docstring'''






						_configure_library_root_logger()

						assert handler is not None
						_get_library_root_logger().addHandler(__lowerCamelCase   )






def _lowerCAmelCase	(  __lowerCamelCase:logging.Handler   ):

						'''simple docstring'''






						_configure_library_root_logger()

						assert handler is not None and handler not in _get_library_root_logger().handlers
						_get_library_root_logger().removeHandler(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						_configure_library_root_logger()
						__magic_name__            =     False






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						_configure_library_root_logger()
						__magic_name__            =     True






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     _get_library_root_logger().handlers

						for handler in handlers:
												__magic_name__            =     logging.Formatter("[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s"   )
												handler.setFormatter(__lowerCamelCase   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						__magic_name__            =     _get_library_root_logger().handlers

						for handler in handlers:
												handler.setFormatter(__lowerCamelCase   )






def _lowerCAmelCase	(  self:Tuple ,						*__lowerCamelCase:List[str] ,						**__lowerCamelCase:Tuple   ):

						'''simple docstring'''






						__magic_name__            =     os.getenv("TRANSFORMERS_NO_ADVISORY_WARNINGS" ,						__lowerCamelCase   )
						if no_advisory_warnings:
												return
						self.warning(*__lowerCamelCase ,						**__lowerCamelCase   )


lowercase    			=       warning_advice






@functools.lru_cache(__lowerCamelCase   )
def _lowerCAmelCase	(  self:Optional[int] ,						*__lowerCamelCase:Optional[Any] ,						**__lowerCamelCase:Optional[Any]   ):

						'''simple docstring'''






						self.warning(*__lowerCamelCase ,						**__lowerCamelCase   )


lowercase    			=       warning_once

class 						A_							:







				def __init__(							self							:						List[Any]						,    *__lowerCamelCase							:						Optional[Any]						,    **__lowerCamelCase							:						List[Any]	)				->					Optional[Any]:  # pylint: disable=unused-argument
										__magic_name__            =     args[0] if args else None







				def __iter__(							self							:						Tuple	)				->					Any:
										return iter(self._iterator	)







				def __getattr__(							self							:						int						,    __lowerCamelCase							:						Optional[Any]	)				->					Tuple:

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

										return empty_fn







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







				def __exit__(							self							:						Dict						,    __lowerCamelCase							:						Union[str, Any]						,    __lowerCamelCase							:						Optional[Any]						,    __lowerCamelCase							:						Optional[int]	)				->					Optional[Any]:
										return





class 						A_							:







				def __call__(							self							:						int						,    *__lowerCamelCase							:						Union[str, Any]						,    **__lowerCamelCase							:						int	)				->					Optional[Any]:
										if _tqdm_active:
																return tqdm_lib.tqdm(*__lowerCamelCase						,    **__lowerCamelCase	)
										else:
																return EmptyTqdm(*__lowerCamelCase						,    **__lowerCamelCase	)







				def     _snake_case					(							self							:						List[str]						,    *__lowerCamelCase							:						int						,    **__lowerCamelCase							:						Optional[int]	)				->					Tuple:
										__magic_name__            =     None
										if _tqdm_active:
																return tqdm_lib.tqdm.set_lock(*__lowerCamelCase						,    **__lowerCamelCase	)







				def     _snake_case					(							self							:						str	)				->					Optional[Any]:
										if _tqdm_active:
																return tqdm_lib.tqdm.get_lock()





lowercase    			=       _tqdm_cls()






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _tqdm_active
						return bool(_tqdm_active   )






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _tqdm_active
						__magic_name__            =     True
						hf_hub_utils.enable_progress_bars()






def _lowerCAmelCase	(  ):

						'''simple docstring'''






						global _tqdm_active
						__magic_name__            =     False
						hf_hub_utils.disable_progress_bars()











"""simple docstring"""

def _lowerCAmelCase	(  __lowerCamelCase:int   ):

						'''simple docstring'''






						__magic_name__            =     n ** (1 / 3)
						return (val * val * val) == n


if __name__ == "__main__":
			print(perfect_cube(27))
			print(perfect_cube(4))



