

'''simple docstring'''






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

from .logging import get_logger


snake_case_       =       set()
snake_case_       =       get_logger(__name__)


def 					__lowerCamelCase			(      SCREAMING_SNAKE_CASE_     :	Optional[str] = None    )							->   Union[str, Any]:
      """simple docstring"""

      def decorator(SCREAMING_SNAKE_CASE_     :	Callable    ):
            global _emitted_deprecation_warnings

            if inspect.isclass(a__    ):
                  SCREAMING_SNAKE_CASE_      :			Optional[int]     =       deprecated_class_or_function.__init__
                  SCREAMING_SNAKE_CASE_      :			Tuple     =       deprecated_class_or_function.__name__
            else:
                  SCREAMING_SNAKE_CASE_      :			str     =       deprecated_class_or_function
                  SCREAMING_SNAKE_CASE_      :			Any     =       deprecated_function.__name__
                  # Support deprecating __init__ class method: class name instead
                  SCREAMING_SNAKE_CASE_      :			Tuple     =       name if name != "__init__" else deprecated_function.__qualname__.split("."    )[-2]

            SCREAMING_SNAKE_CASE_      :			Optional[int]     =       (
                F"{name} is deprecated and will be removed in the next major version of datasets." + F" {help_message}"
                if help_message
                else ""
            )

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

            SCREAMING_SNAKE_CASE_      :			Any     =       "deprecated"

            if inspect.isclass(a__    ):
                  SCREAMING_SNAKE_CASE_      :			List[str]     =       wrapper
                  return deprecated_class_or_function
            else:
                  return wrapper

      return decorator
class 	SCREAMING_SNAKE_CASE__			(				enum.EnumMeta      ):




    def __getattribute__(					cls				,     lowercase__			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Optional[int]     =       super().__getattribute__(lowerCamelCase__			)
          if isinstance(lowerCamelCase__				,     enum.Enum			) and obj._on_access:
                obj._on_access()
          return obj




    def __getitem__(					cls				,     lowercase__			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Dict     =       super().__getitem__(lowerCamelCase__			)
          if member._on_access:
                member._on_access()
          return member







    def __call__(					cls				,     lowercase__				,     lowercase__=None				,     *, lowercase__=None				,     lowercase__=None				,     lowercase__=None				,     lowercase__=1			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			str     =       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=__A      ):




    def __new__(					cls				,     lowercase__			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			List[Any]     =       object.__new__(cls			)
          SCREAMING_SNAKE_CASE_      :			List[Any]     =       value
          SCREAMING_SNAKE_CASE_      :			Tuple     =       member.deprecate
          return member




    @property
    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          return ""







    def   __lowerCamelCase      (					self			):






          """simple docstring"""






          SCREAMING_SNAKE_CASE_      :			Union[str, 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				,     )







'''simple docstring'''
def 				snake_case_  (   a__		:	int			):



    """simple docstring"""




    if not isinstance(a__    ,a__			) or number < 0:
        raise ValueError("""Input must be a non-negative integer"""			)

    __lowercase							=						number & ~(number - 1)
    __lowercase							=						0
    while intermediate:
        intermediate >>= 1
        index += 1
    return index - 1


if __name__ == "__main__":
  import doctest

  doctest.testmod(verbose=True)




