






import warnings

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


lowerCamelCase      :       Any    =						logging.get_logger(__name__)

lowerCamelCase      :       List[str]    =						{
    '''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 				_UpperCamelCase      (a_      ):
      snake_case_	=				"""xlnet"""
      snake_case_	=				["""mems"""]
      snake_case_	=				{
          """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_2_0_0_0       ,    __UpperCamelCase=1_0_2_4       ,    __UpperCamelCase=2_4       ,    __UpperCamelCase=1_6       ,    __UpperCamelCase=4_0_9_6       ,    __UpperCamelCase="gelu"       ,    __UpperCamelCase=True       ,    __UpperCamelCase="bi"       ,    __UpperCamelCase=0.0_2       ,    __UpperCamelCase=1e-12       ,    __UpperCamelCase=0.1       ,    __UpperCamelCase=5_1_2       ,    __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       ,    )->						Any:
           __lowerCAmelCase             =       vocab_size
           __lowerCAmelCase             =       d_model
           __lowerCAmelCase             =       n_layer
           __lowerCAmelCase             =       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})"""						)
           __lowerCAmelCase             =       d_model // n_head
           __lowerCAmelCase             =       ff_activation
           __lowerCAmelCase             =       d_inner
           __lowerCAmelCase             =       untie_r
           __lowerCAmelCase             =       attn_type

           __lowerCAmelCase             =       initializer_range
           __lowerCAmelCase             =       layer_norm_eps

           __lowerCAmelCase             =       dropout
           __lowerCAmelCase             =       mem_len
           __lowerCAmelCase             =       reuse_len
           __lowerCAmelCase             =       bi_data
           __lowerCAmelCase             =       clamp_len
           __lowerCAmelCase             =       same_length

           __lowerCAmelCase             =       summary_type
           __lowerCAmelCase             =       summary_use_proj
           __lowerCAmelCase             =       summary_activation
           __lowerCAmelCase             =       summary_last_dropout
           __lowerCAmelCase             =       start_n_top
           __lowerCAmelCase             =       end_n_top

           __lowerCAmelCase             =       bos_token_id
           __lowerCAmelCase             =       pad_token_id
           __lowerCAmelCase             =       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       ,    )
                __lowerCAmelCase             =       kwargs["use_cache"]

           __lowerCAmelCase             =       use_mems_eval
           __lowerCAmelCase             =       use_mems_train
           super().__init__(pad_token_id=__UpperCamelCase       ,    bos_token_id=__UpperCamelCase       ,    eos_token_id=__UpperCamelCase       ,    **__UpperCamelCase						)


      @property
      def 			__UpperCAmelCase		(						self						)->						List[Any]:
           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 			__UpperCAmelCase		(						self       ,    __UpperCamelCase						)->						List[Any]:
           # 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."""						)














from __future__ import annotations

import os
from typing import Any

import requests

lowerCamelCase      :       Tuple    =						'''https://api.github.com'''

# https://docs.github.com/en/free-pro-team@latest/rest/reference/users#get-the-authenticated-user
lowerCamelCase      :       int    =						BASE_URL + '''/user'''

# https://github.com/settings/tokens
lowerCamelCase      :       Any    =						os.environ.get('''USER_TOKEN''', '''''')





def    __lowerCAmelCase   (    __snake_case							):
     __lowerCAmelCase             =       {
         "Authorization": F"""token {auth_token}""",
         "Accept": "application/vnd.github.v3+json",
     }
     return requests.get(__snake_case       ,			headers=__snake_case							).json()


if __name__ == "__main__":  # pragma: no cover
 if USER_TOKEN:
  for key, value in fetch_github_info(USER_TOKEN).items():
   print(F'''{key}: {value}''')
 else:
  raise ValueError('''\'USER_TOKEN\' field cannot be empty.''')






