from math import factorial, radians
def 		snake_case__	(		lowercase							,				lowercase = 18							,				lowercase = 10					):
   lowerCAmelCase_:							Optional[int]       =	angle_in_degrees - ((angle_in_degrees // 360.0) * 360.0)

   # Converting from degrees to radians
   lowerCAmelCase_:							List[Any]       =	radians(lowercase					)

   lowerCAmelCase_:							Tuple       =	angle_in_radians
   lowerCAmelCase_:							int       =	3
   lowerCAmelCase_:							Dict       =	-1

   for _ in range(lowercase					):
      result += (b * (angle_in_radians**a)) / factorial(lowercase					)

      lowerCAmelCase_:							List[str]       =	-b  # One positive term and the next will be negative and so on...
      a += 2  # Increased by 2 for every term.

   return round(lowercase							,				lowercase					)


if __name__ == "__main__":
 __import__("""doctest""").testmod()
from ...configuration_utils import PretrainedConfig
from ...utils import logging


a  :      Any            =    logging.get_logger(__name__)

a  :      List[str]            =    {
    """transfo-xl-wt103""": """https://huggingface.co/transfo-xl-wt103/resolve/main/config.json""",
}

class 					_lowercase    (     UpperCAmelCase__			):






    '''simple docstring'''
    SCREAMING_SNAKE_CASE:				Optional[Any]          =    'transfo-xl'
    SCREAMING_SNAKE_CASE:				List[Any]          =    ['mems']
    SCREAMING_SNAKE_CASE:				List[Any]          =    {
        'n_token': 'vocab_size',
        'hidden_size': 'd_model',
        'num_attention_heads': 'n_head',
        'num_hidden_layers': 'n_layer',
    }




    def __init__(    self       ,						lowerCamelCase__=267_735       ,						lowerCamelCase__=[20_000, 40_000, 200_000]       ,						lowerCamelCase__=1_024       ,						lowerCamelCase__=1_024       ,						lowerCamelCase__=16       ,						lowerCamelCase__=64       ,						lowerCamelCase__=4_096       ,						lowerCamelCase__=4       ,						lowerCamelCase__=False       ,						lowerCamelCase__=18       ,						lowerCamelCase__=1_600       ,						lowerCamelCase__=1_000       ,						lowerCamelCase__=True       ,						lowerCamelCase__=True       ,						lowerCamelCase__=0       ,						lowerCamelCase__=-1       ,						lowerCamelCase__=True       ,						lowerCamelCase__=0.1       ,						lowerCamelCase__=0.0       ,						lowerCamelCase__=True       ,						lowerCamelCase__="normal"       ,						lowerCamelCase__=0.0_1       ,						lowerCamelCase__=0.0_1       ,						lowerCamelCase__=0.0_2       ,						lowerCamelCase__=1E-5       ,						lowerCamelCase__=0       ,						**lowerCamelCase__       ,						):
       lowerCAmelCase_:							Dict       =	vocab_size
       lowerCAmelCase_:							Any       =	[]
       self.cutoffs.extend(lowerCamelCase__ )
       if proj_share_all_but_first:
          lowerCAmelCase_:							int       =	[False] + [True] * len(self.cutoffs )
       else:
          lowerCAmelCase_:							Any       =	[False] + [False] * len(self.cutoffs )
       lowerCAmelCase_:							Dict       =	d_model
       lowerCAmelCase_:							Union[str, Any]       =	d_embed
       lowerCAmelCase_:							Dict       =	d_head
       lowerCAmelCase_:							Dict       =	d_inner
       lowerCAmelCase_:							List[str]       =	div_val
       lowerCAmelCase_:							List[str]       =	pre_lnorm
       lowerCAmelCase_:							List[str]       =	n_layer
       lowerCAmelCase_:							List[str]       =	n_head
       lowerCAmelCase_:							str       =	mem_len
       lowerCAmelCase_:							Any       =	same_length
       lowerCAmelCase_:							Optional[Any]       =	attn_type
       lowerCAmelCase_:							int       =	clamp_len
       lowerCAmelCase_:							Optional[int]       =	sample_softmax
       lowerCAmelCase_:							Optional[Any]       =	adaptive
       lowerCAmelCase_:							Optional[int]       =	dropout
       lowerCAmelCase_:							Union[str, Any]       =	dropatt
       lowerCAmelCase_:							Tuple       =	untie_r
       lowerCAmelCase_:							Union[str, Any]       =	init
       lowerCAmelCase_:							Optional[Any]       =	init_range
       lowerCAmelCase_:							Optional[Any]       =	proj_init_std
       lowerCAmelCase_:							Tuple       =	init_std
       lowerCAmelCase_:							Tuple       =	layer_norm_epsilon
       super().__init__(eos_token_id=lowerCamelCase__       ,						**lowerCamelCase__ )




    @property
    def      _a    (    self ):
       # Message copied from Transformer-XL documentation
       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      _a    (    self       ,						lowerCamelCase__ ):
       # Message copied from Transformer-XL documentation
       raise NotImplementedError(
           F'''The model {self.model_type} is one of the few models that has no sequence length limit.''' )