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

from .logging import get_logger


lowerCamelCase_				:		Union[str, Any]       						=       set()
lowerCamelCase_				:		Union[str, Any]       						=       get_logger(__name__)
def 							lowerCAmelCase(	__lowerCamelCase = None						):

					def decorator(__lowerCamelCase						):
										global _emitted_deprecation_warnings

										if inspect.isclass(__lowerCamelCase						):
															__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(__lowerCamelCase						)
										def wrapper(*__lowerCamelCase      ,				**__lowerCamelCase						):
															__a							=   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							=   'deprecated'

										if inspect.isclass(__lowerCamelCase						):
															__a							=   wrapper
															return deprecated_class_or_function
										else:
															return wrapper

					return decorator


class 						a__							(   enum.EnumMeta		):



			def __getattribute__(						cls      ,						UpperCAmelCase    ) ->    Dict:
								__a							=   super().__getattribute__(UpperCAmelCase    )
								if isinstance(UpperCAmelCase      ,						enum.Enum    ) and obj._on_access:
													obj._on_access()
								return obj



			def __getitem__(						cls      ,						UpperCAmelCase    ) ->    Union[str, Any]:
								__a							=   super().__getitem__(UpperCAmelCase    )
								if member._on_access:
													member._on_access()
								return member







			def __call__(						cls      ,						UpperCAmelCase      ,						UpperCAmelCase=None      ,						*, UpperCAmelCase=None      ,						UpperCAmelCase=None      ,						UpperCAmelCase=None      ,						UpperCAmelCase=1    ) ->    Optional[int]:
								__a							=   super().__call__(UpperCAmelCase      ,						UpperCAmelCase      ,						module=UpperCAmelCase      ,						qualname=UpperCAmelCase      ,						type=UpperCAmelCase      ,						start=UpperCAmelCase    )
								if isinstance(UpperCAmelCase      ,						enum.Enum    ) and obj._on_access:
													obj._on_access()
								return obj






class 						a__							(   enum.Enum      ,						metaclass=UpperCAmelCase_		):



			def __new__(						cls      ,						UpperCAmelCase    ) ->    Optional[Any]:
								__a							=   object.__new__(cls    )
								__a							=   value
								__a							=   member.deprecate
								return member



			@property
			def __SCREAMING_SNAKE_CASE							(						self    ) ->    str:
								return ""







			def __SCREAMING_SNAKE_CASE							(						self    ) ->    Optional[Any]:
								__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      ,						UpperCAmelCase      ,						stacklevel=3      ,						)











from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowerCAmelCase_        =			logging.get_logger(__name__)

lowerCAmelCase_        =			{
    """google/mobilebert-uncased""": """https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json"""
}



class 				_lowerCAmelCase			(	UpperCAmelCase_							):


  '''simple docstring'''
  a_							:				List[Any]					    =MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP
  a_							:				Union[str, Any]					    ="""mobilebert"""







  def __init__(					self					:    int					, UpperCamelCase					:    int=3_05_22					, UpperCamelCase					:    Any=5_12					, UpperCamelCase					:    Any=24					, UpperCamelCase					:    List[str]=4					, UpperCamelCase					:    Any=5_12					, UpperCamelCase					:    str="relu"					, UpperCamelCase					:    Dict=0.0					, UpperCamelCase					:    int=0.1					, UpperCamelCase					:    Optional[Any]=5_12					, UpperCamelCase					:    str=2					, UpperCamelCase					:    Tuple=0.02					, UpperCamelCase					:    Union[str, Any]=1e-1_2					, UpperCamelCase					:    Optional[Any]=0					, UpperCamelCase					:    Union[str, Any]=1_28					, UpperCamelCase					:    Tuple=True					, UpperCamelCase					:    int=True					, UpperCamelCase					:    List[Any]=1_28					, UpperCamelCase					:    Dict=False					, UpperCamelCase					:    List[str]=True					, UpperCamelCase					:    Optional[Any]=4					, UpperCamelCase					:    int="no_norm"					, UpperCamelCase					:    Tuple=True					, UpperCamelCase					:    str=None					, **UpperCamelCase					:    str					, ):


    '''simple docstring'''





    super().__init__(pad_token_id=UpperCamelCase					, **UpperCamelCase							)

    _snake_case      : Union[str, Any]														=		vocab_size
    _snake_case      : Any														=		hidden_size
    _snake_case      : Tuple														=		num_hidden_layers
    _snake_case      : Any														=		num_attention_heads
    _snake_case      : Optional[Any]														=		hidden_act
    _snake_case      : List[Any]														=		intermediate_size
    _snake_case      : List[Any]														=		hidden_dropout_prob
    _snake_case      : Optional[int]														=		attention_probs_dropout_prob
    _snake_case      : int														=		max_position_embeddings
    _snake_case      : Optional[int]														=		type_vocab_size
    _snake_case      : Any														=		initializer_range
    _snake_case      : Optional[int]														=		layer_norm_eps
    _snake_case      : Tuple														=		embedding_size
    _snake_case      : int														=		trigram_input
    _snake_case      : Optional[int]														=		use_bottleneck
    _snake_case      : List[Any]														=		intra_bottleneck_size
    _snake_case      : Any														=		use_bottleneck_attention
    _snake_case      : str														=		key_query_shared_bottleneck
    _snake_case      : List[str]														=		num_feedforward_networks
    _snake_case      : int														=		normalization_type
    _snake_case      : str														=		classifier_activation

    if self.use_bottleneck:
      _snake_case      : Any														=		intra_bottleneck_size
    else:
      _snake_case      : Union[str, Any]														=		hidden_size

    _snake_case      : Dict														=		classifier_dropout




class 				_lowerCAmelCase			(	UpperCAmelCase_							):


  '''simple docstring'''







  @property
  def UpperCamelCase_       (					self					:    List[Any]							):


    '''simple docstring'''





    if self.task == "multiple-choice":
      _snake_case      : str														=		{0: 'batch', 1: 'choice', 2: 'sequence'}
    else:
      _snake_case      : Dict														=		{0: 'batch', 1: 'sequence'}
    return OrderedDict(
        [
            ('input_ids', dynamic_axis),
            ('attention_mask', dynamic_axis),
            ('token_type_ids', dynamic_axis),
        ]							)




