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

from .logging import get_logger


UpperCAmelCase							   =      set()
UpperCAmelCase							   =      get_logger(__name__)







def 	UpperCAmelCase       (		lowerCAmelCase_ = None       )	->	Optional[int]:

     def decorator(lowerCAmelCase_       ):
          global _emitted_deprecation_warnings

          if inspect.isclass(lowerCAmelCase_       ):
               a  :    Tuple				=						deprecated_class_or_function.__init__
               a  :    List[Any]				=						deprecated_class_or_function.__name__
          else:
               a  :    Optional[Any]				=						deprecated_class_or_function
               a  :    Optional[int]				=						deprecated_function.__name__
               # Support deprecating __init__ class method: class name instead
               a  :    int				=						name if name != '''__init__''' else deprecated_function.__qualname__.split('''.'''       )[-2]

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

          @wraps(lowerCAmelCase_       )
          def wrapper(*lowerCAmelCase_						,      **lowerCAmelCase_       ):
               a  :    Optional[Any]				=						hash(lowerCAmelCase_       )
               if func_hash not in _emitted_deprecation_warnings:
                    warnings.warn(lowerCAmelCase_						,      category=lowerCAmelCase_						,      stacklevel=2       )
                    _emitted_deprecation_warnings.add(lowerCAmelCase_       )
               return deprecated_function(*lowerCAmelCase_						,      **lowerCAmelCase_       )

          a  :    str				=						'''deprecated'''

          if inspect.isclass(lowerCAmelCase_       ):
               a  :    str				=						wrapper
               return deprecated_class_or_function
          else:
               return wrapper

     return decorator






class 							_SCREAMING_SNAKE_CASE(   enum.EnumMeta	):
   def __getattribute__(    cls							,     lowerCAmelCase_    )	->Tuple:
        a  :    str				=						super().__getattribute__(lowerCAmelCase_    )
        if isinstance(lowerCAmelCase_							,     enum.Enum    ) and obj._on_access:
             obj._on_access()
        return obj
   def __getitem__(    cls							,     lowerCAmelCase_    )	->List[Any]:
        a  :    Tuple				=						super().__getitem__(lowerCAmelCase_    )
        if member._on_access:
             member._on_access()
        return member


   def __call__(    cls							,     lowerCAmelCase_							,     lowerCAmelCase_=None							,     *, lowerCAmelCase_=None							,     lowerCAmelCase_=None							,     lowerCAmelCase_=None							,     lowerCAmelCase_=1    )	->Tuple:
        a  :    Tuple				=						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 							_SCREAMING_SNAKE_CASE(   enum.Enum       ,      metaclass=snake_case__	):
   def __new__(    cls							,     lowerCAmelCase_    )	->Dict:
        a  :    Union[str, Any]				=						object.__new__(cls    )
        a  :    Union[str, Any]				=						value
        a  :    int				=						member.deprecate
        return member
   @property
   def _lowercase(    self    )	->List[str]:
        return ""


   def _lowercase(    self    )	->Any:
        a  :    Any				=						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							,     )
def 	UpperCAmelCase       (		lowerCAmelCase_       )	->	int:
     return 1 if input_a == 0 else 0







def 	UpperCAmelCase       (		)	->	None:
     assert not_gate(0       ) == 1
     assert not_gate(1       ) == 0


if __name__ == "__main__":
  print(not_gate(0))
  print(not_gate(1))