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


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

__lowerCAmelCase    :							Optional[int]													=						logging.WARNING







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		lowerCAmelCase__        =   os.getenv("""DATASETS_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 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"""




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







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




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







def 							_UpperCAmelCase		(       lowerCamelCase__ = None     ):





		"""simple docstring"""




		if name is None:
				lowerCAmelCase__        =   _get_library_name()
		return logging.getLogger(lowerCamelCase__     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return _get_library_root_logger().getEffectiveLevel()







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		_get_library_root_logger().setLevel(lowerCamelCase__     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return set_verbosity(lowerCamelCase__     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return set_verbosity(lowerCamelCase__     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return set_verbosity(lowerCamelCase__     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		return set_verbosity(lowerCamelCase__     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		lowerCAmelCase__        =   False







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		lowerCAmelCase__        =   True


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

class       a_      :




					def __init__(	self						:     str  ,						*snake_case__						:     Any  ,						**snake_case__						:     List[Any]     ):  # pylint: disable=unused-argument
							lowerCAmelCase__        =   args[0] if args else None




					def __iter__(	self						:     List[Any]     ):
							return iter(self._iterator     )




					def __getattr__(	self						:     Any  ,						snake_case__						:     Dict     ):

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

							return empty_fn




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




					def __exit__(	self						:     int  ,						snake_case__						:     str  ,						snake_case__						:     List[str]  ,						snake_case__						:     str     ):
							return
__lowerCAmelCase    :							Tuple													=						True

class       a_      :




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




					def 						_SCREAMING_SNAKE_CASE						(	self						:     List[str]  ,						*snake_case__						:     str  ,						**snake_case__						:     str     ):
							lowerCAmelCase__        =   None
							if _tqdm_active:
									return tqdm_lib.tqdm.set_lock(*snake_case__  ,						**snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Any     ):
							if _tqdm_active:
									return tqdm_lib.tqdm.get_lock()
__lowerCAmelCase    :							Union[str, Any]													=						_tqdm_cls()







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		global _tqdm_active
		return bool(_tqdm_active     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		global _tqdm_active
		lowerCAmelCase__        =   True







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		global _tqdm_active
		lowerCAmelCase__        =   False





"""simple docstring"""




from math import pi, sqrt







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		if num <= 0:
				raise ValueError("""math domain error"""     )
		if num > 1_71.5:
				raise OverflowError("""math range error"""     )
		elif num - int(lowerCamelCase__     ) not in (0, 0.5):
				raise NotImplementedError("""num must be an integer or a half-integer"""     )
		elif num == 0.5:
				return sqrt(lowerCamelCase__     )
		else:
				return 1.0 if num == 1 else (num - 1) * gamma(num - 1     )







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		assert gamma(0.5     ) == sqrt(lowerCamelCase__     )
		assert gamma(1     ) == 1.0
		assert gamma(2     ) == 1.0


if __name__ == "__main__":
			from doctest import testmod

			testmod()
			__lowerCAmelCase    :							Dict													=						1.0
			while num:
						__lowerCAmelCase    :							Any													=						float(input("Gamma of: "))
						print(F"gamma({num}) = {gamma(num)}")
						print("\nEnter 0 to exit...")




