






"""simple docstring"""


import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional

from .logging import get_logger


lowercase_								=	set()
lowercase_								=	get_logger(__name__)



def    lowerCAmelCase							(       __UpperCamelCase = None					):




  """simple docstring"""







  def decorator(__UpperCamelCase					):
    global _emitted_deprecation_warnings

    if inspect.isclass(__UpperCamelCase					):
      __A		     =					deprecated_class_or_function.__init__
      __A		     =					deprecated_class_or_function.__name__
    else:
      __A		     =					deprecated_class_or_function
      __A		     =					deprecated_function.__name__
      # Support deprecating __init__ class method: class name instead
      __A		     =					name if name != '''__init__''' else deprecated_function.__qualname__.split('''.'''					)[-2]

    __A		     =					(
        f'{name} is deprecated and will be removed in the next major version of datasets.' + f' {help_message}'
        if help_message
        else ''''''
    )

    @wraps(__UpperCamelCase					)
    def wrapper(*__UpperCamelCase						,			**__UpperCamelCase					):
      __A		     =					hash(__UpperCamelCase					)
      if func_hash not in _emitted_deprecation_warnings:
        warnings.warn(__UpperCamelCase						,			category=__UpperCamelCase						,			stacklevel=2					)
        _emitted_deprecation_warnings.add(__UpperCamelCase					)
      return deprecated_function(*__UpperCamelCase						,			**__UpperCamelCase					)

    __A		     =					'''deprecated'''

    if inspect.isclass(__UpperCamelCase					):
      __A		     =					wrapper
      return deprecated_class_or_function
    else:
      return wrapper

  return decorator


class    snake_case						(				enum.EnumMeta		):


   '''simple docstring'''

   def __getattribute__(      cls					:	Any,			_lowerCamelCase					:	Optional[int]    ):

     '''simple docstring'''
     __A		     =					super().__getattribute__(_lowerCamelCase    )
     if isinstance(_lowerCamelCase,			enum.Enum    ) and obj._on_access:
       obj._on_access()
     return obj


   def __getitem__(      cls					:	Dict,			_lowerCamelCase					:	Any    ):

     '''simple docstring'''
     __A		     =					super().__getitem__(_lowerCamelCase    )
     if member._on_access:
       member._on_access()
     return member






   def __call__(      cls					:	Optional[Any],			_lowerCamelCase					:	Optional[Any],			_lowerCamelCase					:	Optional[Any]=None,			*, _lowerCamelCase					:	List[Any]=None,			_lowerCamelCase					:	Union[str, Any]=None,			_lowerCamelCase					:	Optional[Any]=None,			_lowerCamelCase					:	List[Any]=1    ):

     '''simple docstring'''
     __A		     =					super().__call__(_lowerCamelCase,			_lowerCamelCase,			module=_lowerCamelCase,			qualname=_lowerCamelCase,			type=_lowerCamelCase,			start=_lowerCamelCase    )
     if isinstance(_lowerCamelCase,			enum.Enum    ) and obj._on_access:
       obj._on_access()
     return obj





class    snake_case						(				enum.Enum  ,      metaclass=_lowerCAmelCase		):


   '''simple docstring'''

   def __new__(      cls					:	Union[str, Any],			_lowerCamelCase					:	Any    ):

     '''simple docstring'''
     __A		     =					object.__new__(cls    )
     __A		     =					value
     __A		     =					member.deprecate
     return member


   @property
   def 							_SCREAMING_SNAKE_CASE							(      self					:	Optional[int]    ):

     '''simple docstring'''
     return ""






   def 							_SCREAMING_SNAKE_CASE							(      self					:	int    ):

     '''simple docstring'''
     __A		     =					f' {self.help_message}' if self.help_message else ''''''
     warnings.warn(
         f'\'{self.__objclass__.__name__}\' is deprecated and will be removed in the next major version of datasets.'
         + help_message,			_lowerCamelCase,			stacklevel=3,			)











from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
a_    :				List[str]					=			TypeVar('T', bound='Enum')



@unique
class  SCREAMING_SNAKE_CASE_  ( SCREAMING_SNAKE_CASE__			):


  """simple docstring"""





  _a								=							80
  _a								=							70
  _a								=							60
  _a								=							50
  _a								=							40
  _a								=							30
  _a								=							20
  _a								=							10



@unique
class  SCREAMING_SNAKE_CASE_  ( SCREAMING_SNAKE_CASE__			):


  """simple docstring"""





  _a								=							24
  _a								=							21
  _a								=							18
  _a								=							15
  _a								=							12
  _a								=							9
  _a								=							6
  _a								=							3
  _a								=							2
  _a								=							1
  _a								=							-1
  _a								=							-2
  _a								=							-3
  _a								=							-6
  _a								=							-9
  _a								=							-12
  _a								=							-15
  _a								=							-18
  _a								=							-21
  _a								=							-24





  @classmethod
  def 			__A      (  cls						)		->   dict:





       '''simple docstring'''







       return {unit.name: unit.value for unit in cls if unit.value > 0}







  @classmethod
  def 			__A      (  cls						)		->   dict:





       '''simple docstring'''







       return {unit.name: unit.value for unit in cls if unit.value < 0}




def   _SCREAMING_SNAKE_CASE      (	snake_case_		:						float						):
     __magic_name__				=       SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
     for name_prefix, value_prefix in prefixes.items():
          __magic_name__				=       value / (10**value_prefix)
          if numerical_part > 1:
               return f'{numerical_part!s} {name_prefix}'
     return str(snake_case_						)




def   _SCREAMING_SNAKE_CASE      (	snake_case_		:						float						):
     for prefix in BinaryUnit:
          __magic_name__				=       value / (2**prefix.value)
          if numerical_part > 1:
               return f'{numerical_part!s} {prefix.name}'
     return str(snake_case_						)


if __name__ == "__main__":
    import doctest

    doctest.testmod()