



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


a_   :List[Any]        =      threading.Lock()
a_   :str        =      None

a_   :Optional[Any]        =      {
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

a_   :List[str]        =      logging.WARNING

a_   :str        =      True
def        lowercase_							():
       snake_case__							:	str   	=	os.getenv('TRANSFORMERS_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 TRANSFORMERS_VERBOSITY={env_level_str}, '''
                         F'''has to be one of: { ", ".join(log_levels.keys()      ) }'''      )
       return _default_log_level
def        lowercase_							():
       return __name__.split('.'      )[0]
def        lowercase_							():
       return logging.getLogger(_get_library_name()      )
def        lowercase_							():
       global _default_handler

       with _lock:
              if _default_handler:
                     # This library has already configured the library root logger.
                     return
              snake_case__							:	Union[str, Any]   	=	logging.StreamHandler()  # Set sys.stderr as stream.
              snake_case__							:	Tuple   	=	sys.stderr.flush

              # Apply our default configuration to the library root logger.
              snake_case__							:	int   	=	_get_library_root_logger()
              library_root_logger.addHandler(_default_handler      )
              library_root_logger.setLevel(_get_default_logging_level()      )
              snake_case__							:	List[str]   	=	False
def        lowercase_							():
       global _default_handler

       with _lock:
              if not _default_handler:
                     return

              snake_case__							:	List[str]   	=	_get_library_root_logger()
              library_root_logger.removeHandler(_default_handler      )
              library_root_logger.setLevel(logging.NOTSET      )
              snake_case__							:	Tuple   	=	None
def        lowercase_							():
       return log_levels
def        lowercase_							(A : Union[str, Any] = None      ):

       if name is None:
              snake_case__							:	Optional[int]   	=	_get_library_name()

       _configure_library_root_logger()
       return logging.getLogger(snake_case_      )
def        lowercase_							():
       _configure_library_root_logger()
       return _get_library_root_logger().getEffectiveLevel()
def        lowercase_							(A : Union[str, Any]      ):
       _configure_library_root_logger()
       _get_library_root_logger().setLevel(snake_case_      )
def        lowercase_							():
       return set_verbosity(snake_case_      )
def        lowercase_							():
       return set_verbosity(snake_case_      )
def        lowercase_							():
       return set_verbosity(snake_case_      )
def        lowercase_							():
       return set_verbosity(snake_case_      )
def        lowercase_							():
       _configure_library_root_logger()

       assert _default_handler is not None
       _get_library_root_logger().removeHandler(_default_handler      )
def        lowercase_							():
       _configure_library_root_logger()

       assert _default_handler is not None
       _get_library_root_logger().addHandler(_default_handler      )
def        lowercase_							(A : Dict      ):
       _configure_library_root_logger()

       assert handler is not None
       _get_library_root_logger().addHandler(snake_case_      )
def        lowercase_							(A : Dict      ):
       _configure_library_root_logger()

       assert handler is not None and handler not in _get_library_root_logger().handlers
       _get_library_root_logger().removeHandler(snake_case_      )
def        lowercase_							():
       _configure_library_root_logger()
       snake_case__							:	Union[str, Any]   	=	False
def        lowercase_							():
       _configure_library_root_logger()
       snake_case__							:	List[Any]   	=	True
def        lowercase_							():
       snake_case__							:	Union[str, Any]   	=	_get_library_root_logger().handlers

       for handler in handlers:
              snake_case__							:	str   	=	logging.Formatter('[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s'      )
              handler.setFormatter(snake_case_      )
def        lowercase_							():
       snake_case__							:	Any   	=	_get_library_root_logger().handlers

       for handler in handlers:
              handler.setFormatter(snake_case_      )
def        lowercase_							(self : str		,					*A : Any		,					**A : Union[str, Any]      ):
       snake_case__							:	str   	=	os.getenv('TRANSFORMERS_NO_ADVISORY_WARNINGS'		,					snake_case_      )
       if no_advisory_warnings:
              return
       self.warning(*snake_case_		,					**snake_case_      )


a_   :Optional[Any]        =      warning_advice
@functools.lru_cache(snake_case_      )
def        lowercase_							(self : str		,					*A : int		,					**A : int      ):
       self.warning(*snake_case_		,					**snake_case_      )


a_   :str        =      warning_once




class 					snake_case__						:






     """simple docstring"""


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






     def __iter__(       self  :  List[str]					)   ->Optional[Any]:
            return iter(self._iterator					)






     def __getattr__(       self  :  List[str], _snake_case  :  List[Any]					)   ->Union[str, Any]:

            def empty_fn(*_snake_case  :  Optional[Any], **_snake_case  :  Tuple					):  # pylint: disable=unused-argument
                   return

            return empty_fn






     def __enter__(       self  :  Union[str, Any]					)   ->Tuple:
            return self






     def __exit__(       self  :  int, _snake_case  :  str, _snake_case  :  List[str], _snake_case  :  Optional[Any]					)   ->List[str]:
            return




class 					snake_case__						:






     """simple docstring"""


     def __call__(       self  :  List[str], *_snake_case  :  Any, **_snake_case  :  List[Any]					)   ->Union[str, Any]:
            if _tqdm_active:
                   return tqdm_lib.tqdm(*_a, **_a					)
            else:
                   return EmptyTqdm(*_a, **_a					)






     def    lowercase_   (       self  :  List[str], *_snake_case  :  List[str], **_snake_case  :  List[str]					)   ->Dict:
            snake_case__							:	Optional[Any]   	=	None
            if _tqdm_active:
                   return tqdm_lib.tqdm.set_lock(*_a, **_a					)






     def    lowercase_   (       self  :  Tuple					)   ->Union[str, Any]:
            if _tqdm_active:
                   return tqdm_lib.tqdm.get_lock()


a_   :str        =      _tqdm_cls()
def        lowercase_							():
       global _tqdm_active
       return bool(_tqdm_active      )
def        lowercase_							():
       global _tqdm_active
       snake_case__							:	Optional[int]   	=	True
       hf_hub_utils.enable_progress_bars()





def        lowercase_							():
       global _tqdm_active
       snake_case__							:	List[str]   	=	False
       hf_hub_utils.disable_progress_bars()












from math import asin, atan, cos, radians, sin, sqrt, tan

_snake_case										=       6_3_7_8_1_3_7.0
_snake_case										=       6_3_5_6_7_5_2.3_1_4_2_4_5
_snake_case										=       6378137







def 				lowerCAmelCase_	(     snake_case_,snake_case_,snake_case_,snake_case_     ):
      _A							:     Any			=						(AXIS_A - AXIS_B) / AXIS_A
      _A							:     Optional[int]			=						atan((1 - flattening) * tan(radians(snake_case_     )     )     )
      _A							:     List[str]			=						atan((1 - flattening) * tan(radians(snake_case_     )     )     )
      _A							:     Optional[Any]			=						radians(snake_case_     )
      _A							:     str			=						radians(snake_case_     )
      # Equation
      _A							:     Dict			=						sin((phi_a - phi_a) / 2     )
      _A							:     List[str]			=						sin((lambda_a - lambda_a) / 2     )
      # Square both values
      sin_sq_phi *= sin_sq_phi
      sin_sq_lambda *= sin_sq_lambda
      _A							:     Optional[int]			=						sqrt(sin_sq_phi + (cos(snake_case_     ) * cos(snake_case_     ) * sin_sq_lambda)     )
      return 2 * RADIUS * asin(snake_case_     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()

