





'''simple docstring'''




import warnings

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__   :				Optional[int]      =   logging.get_logger(__name__)

lowercase__   :				Union[str, Any]      =   {
    '''xlnet-base-cased''': '''https://huggingface.co/xlnet-base-cased/resolve/main/config.json''',
    '''xlnet-large-cased''': '''https://huggingface.co/xlnet-large-cased/resolve/main/config.json''',
}


class 			SCREAMING_SNAKE_CASE   (a__							):
     lowerCAmelCase		      =	'''xlnet'''
     lowerCAmelCase		      =	['''mems''']
     lowerCAmelCase		      =	{
         '''n_token''': '''vocab_size''',  # Backward compatibility
         '''hidden_size''': '''d_model''',
         '''num_attention_heads''': '''n_head''',
         '''num_hidden_layers''': '''n_layer''',
     }


     def __init__(						self						,     _UpperCAmelCase=3_2000						,     _UpperCAmelCase=1024						,     _UpperCAmelCase=24						,     _UpperCAmelCase=16						,     _UpperCAmelCase=4096						,     _UpperCAmelCase="gelu"						,     _UpperCAmelCase=True						,     _UpperCAmelCase="bi"						,     _UpperCAmelCase=0.02						,     _UpperCAmelCase=1e-1_2						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=512						,     _UpperCAmelCase=None						,     _UpperCAmelCase=True						,     _UpperCAmelCase=False						,     _UpperCAmelCase=False						,     _UpperCAmelCase=-1						,     _UpperCAmelCase=False						,     _UpperCAmelCase="last"						,     _UpperCAmelCase=True						,     _UpperCAmelCase="tanh"						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=5						,     _UpperCAmelCase=5						,     _UpperCAmelCase=5						,     _UpperCAmelCase=1						,     _UpperCAmelCase=2						,     **_UpperCAmelCase						,     ):

          '''simple docstring'''






          __A						:			List[Any]								=	vocab_size
          __A						:			Optional[Any]								=	d_model
          __A						:			Dict								=	n_layer
          __A						:			Union[str, Any]								=	n_head
          if d_model % n_head != 0:
               raise ValueError(F'\'d_model % n_head\' ({d_model % n_head}) should be equal to 0')
          if "d_head" in kwargs:
               if kwargs["d_head"] != d_model // n_head:
                    raise ValueError(
                        F'`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})')
          __A						:			Tuple								=	d_model // n_head
          __A						:			Optional[int]								=	ff_activation
          __A						:			Union[str, Any]								=	d_inner
          __A						:			List[Any]								=	untie_r
          __A						:			List[str]								=	attn_type

          __A						:			int								=	initializer_range
          __A						:			List[Any]								=	layer_norm_eps

          __A						:			List[Any]								=	dropout
          __A						:			int								=	mem_len
          __A						:			Optional[int]								=	reuse_len
          __A						:			Union[str, Any]								=	bi_data
          __A						:			Any								=	clamp_len
          __A						:			str								=	same_length

          __A						:			List[str]								=	summary_type
          __A						:			Optional[int]								=	summary_use_proj
          __A						:			Union[str, Any]								=	summary_activation
          __A						:			str								=	summary_last_dropout
          __A						:			Tuple								=	start_n_top
          __A						:			Tuple								=	end_n_top

          __A						:			Optional[Any]								=	bos_token_id
          __A						:			Tuple								=	pad_token_id
          __A						:			List[Any]								=	eos_token_id

          if "use_cache" in kwargs:
               warnings.warn(
                   'The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'
                   ' instead.'						,     _UpperCAmelCase						,     )
               __A						:			Optional[Any]								=	kwargs['use_cache']

          __A						:			int								=	use_mems_eval
          __A						:			Any								=	use_mems_train
          super().__init__(pad_token_id=_UpperCAmelCase						,     bos_token_id=_UpperCAmelCase						,     eos_token_id=_UpperCAmelCase						,     **_UpperCAmelCase)


     @property
     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          logger.info(F'The model {self.model_type} is one of the few models that has no sequence length limit.')
          return -1


     @max_position_embeddings.setter
     def 							SCREAMING_SNAKE_CASE  (						self						,     _UpperCAmelCase):

          '''simple docstring'''






          raise NotImplementedError(
              F'The model {self.model_type} is one of the few models that has no sequence length limit.')








'''simple docstring'''




import math






def 	_lowerCAmelCase      (  __snake_case  :			int      )					->					int:

     if not isinstance(__snake_case			,							__snake_case      ):
          __A						:			List[Any]								=	f'Input value of [number={number}] must be an integer'
          raise TypeError(__snake_case      )

     if number < 1:
          __A						:			Union[str, Any]								=	f'Input value of [number={number}] must be > 0'
          raise ValueError(__snake_case      )
     elif number == 1:
          return 3
     elif number == 2:
          return 5
     else:
          __A						:			Optional[Any]								=	int(math.log(number // 3			,							2      )      ) + 2

          __A						:			Union[str, Any]								=	[3, 5]
          __A						:			List[Any]								=	2
          __A						:			Optional[Any]								=	3
          for block in range(1			,							__snake_case      ):
               for _ in range(__snake_case      ):
                    proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]      )
                    proth_index += 1
               increment *= 2

     return proth_list[number - 1]


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  for number in range(11):
    lowercase__   :				str      =   0
    try:
      lowercase__   :				List[str]      =   proth(number)
    except ValueError:
      print(f"""ValueError: there is no {number}th Proth number""")
      continue

    print(f"""The {number}th Proth number: {value}""")