




"""simple docstring"""







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

from .logging import get_logger


SCREAMING_SNAKE_CASE_      =					set()
SCREAMING_SNAKE_CASE_      =					get_logger(__name__)





def     __snake_case   (							_lowercase = None						):


    """simple docstring"""







    def decorator(_lowercase						):
        global _emitted_deprecation_warnings

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

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

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

        UpperCamelCase										=  'deprecated'

        if inspect.isclass(lowercase_						):
            UpperCamelCase										=  wrapper
            return deprecated_class_or_function
        else:
            return wrapper

    return decorator

class 							snake_case_ (				enum.EnumMeta ):







   """simple docstring"""




   def __getattribute__(		cls					,				lowerCamelCase_)							->      Any:
       UpperCamelCase										=  super().__getattribute__(lowerCamelCase_)
       if isinstance(lowerCamelCase_					,				enum.Enum) and obj._on_access:
           obj._on_access()
       return obj







   def __getitem__(		cls					,				lowerCamelCase_)							->      List[Any]:
       UpperCamelCase										=  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)							->      Optional[Any]:
       UpperCamelCase										=  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=a_ ):







   """simple docstring"""




   def __new__(		cls					,				lowerCamelCase_)							->      str:
       UpperCamelCase										=  object.__new__(cls)
       UpperCamelCase										=  value
       UpperCamelCase										=  member.deprecate
       return member







   @property
   def      UpperCAmelCase__ (		self)							->      Tuple:
       return ""







   def      UpperCAmelCase__ (		self)							->      str:
       UpperCamelCase										=  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"""







import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig

class 							snake_case_ (				lowerCamelCase_ ):







   """simple docstring"""




   A_										=					CustomConfig







   def __init__(		self					,				lowerCamelCase_)							->      List[Any]:
       super().__init__(lowerCamelCase_)
       UpperCamelCase										=  torch.nn.Linear(config.hidden_size					,				config.hidden_size)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      Optional[Any]:
       return self.linear(lowerCamelCase_)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      List[str]:
       pass

class 							snake_case_ (				lowerCamelCase_ ):







   """simple docstring"""




   A_										=					NoSuperInitConfig







   def __init__(		self					,				lowerCamelCase_)							->      Optional[int]:
       super().__init__(lowerCamelCase_)
       UpperCamelCase										=  torch.nn.Linear(config.attribute					,				config.attribute)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      int:
       return self.linear(lowerCamelCase_)







   def      UpperCAmelCase__ (		self					,				lowerCamelCase_)							->      Any:
       pass