'''simple docstring'''

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

from .logging import get_logger


A_	   = set()
A_	   = get_logger(__name__)


def        UpperCAmelCase__   (				_lowerCAmelCase    :			Optional[str] = None)    ->		Any:



						"""simple docstring"""

						def decorator(_lowerCAmelCase    :			Callable):
												global _emitted_deprecation_warnings

												if inspect.isclass(_lowerCAmelCase):
																		snake_case :       Any				=    deprecated_class_or_function.__init__
																		snake_case :       Union[str, Any]				=    deprecated_class_or_function.__name__
												else:
																		snake_case :       Dict				=    deprecated_class_or_function
																		snake_case :       List[Any]				=    deprecated_function.__name__
																		# Support deprecating __init__ class method: class name instead
																		snake_case :       Optional[int]				=    name if name != "__init__" else deprecated_function.__qualname__.split(".")[-2]

												snake_case :       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    :			int,      **_lowerCAmelCase    :			Tuple):
																		snake_case :       Tuple				=    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)

												snake_case :       Tuple				=    "deprecated"

												if inspect.isclass(_lowerCAmelCase):
																		snake_case :       Union[str, Any]				=    wrapper
																		return deprecated_class_or_function
												else:
																		return wrapper

						return decorator




class 		SCREAMING_SNAKE_CASE_					(enum.EnumMeta      ):



			"""simple docstring"""






			def __getattribute__(							cls				,			snake_case_					):
									snake_case :       int				=    super().__getattribute__(snake_case_					)
									if isinstance(snake_case_				,			enum.Enum					) and obj._on_access:
															obj._on_access()
									return obj



			def __getitem__(							cls				,			snake_case_					):
									snake_case :       Dict				=    super().__getitem__(snake_case_					)
									if member._on_access:
															member._on_access()
									return member






			def __call__(							cls				,			snake_case_				,			snake_case_=None				,			*, snake_case_=None				,			snake_case_=None				,			snake_case_=None				,			snake_case_=1					):
									snake_case :       Tuple				=    super().__call__(snake_case_				,			snake_case_				,			module=snake_case_				,			qualname=snake_case_				,			type=snake_case_				,			start=snake_case_					)
									if isinstance(snake_case_				,			enum.Enum					) and obj._on_access:
															obj._on_access()
									return obj







class 		SCREAMING_SNAKE_CASE_					(enum.Enum							,				metaclass=_UpperCAmelCase      ):



			"""simple docstring"""






			def __new__(							cls				,			snake_case_					):
									snake_case :       Any				=    object.__new__(cls					)
									snake_case :       Union[str, Any]				=    value
									snake_case :       Union[str, Any]				=    member.deprecate
									return member



			@property
			def   lowerCamelCase (							self					):
									return ""






			def   lowerCamelCase (							self					):
									snake_case :       str				=    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				,			snake_case_				,			stacklevel=3				,			)






'''simple docstring'''

from __future__ import annotations


def        UpperCAmelCase__   (				_lowerCAmelCase    :			list[int | float])    ->		int | float:



						"""simple docstring"""

						if len(_lowerCAmelCase) == 0:
												raise ValueError("find_max() arg is an empty sequence")
						snake_case :       Any				=    nums[0]
						for x in nums:
												if x > max_num:
																		snake_case :       int				=    x
						return max_num


if __name__ == "__main__":
						import doctest

						doctest.testmod(verbose=True)





