




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


_lowerCAmelCase    : Optional[Any]		= logging.get_logger(__name__)

_lowerCAmelCase    : Union[str, Any]		= {
    # pcqm4mv1 now deprecated
    "graphormer-base": "https://huggingface.co/clefourrier/graphormer-base-pcqm4mv2/resolve/main/config.json",
    # See all Graphormer models at https://huggingface.co/models?filter=graphormer
}
class       _UpperCamelCase   (					UpperCamelCase__		):
      UpperCAmelCase_          =		"graphormer"
      UpperCAmelCase_          =		["past_key_values"]
      def __init__(      self :str			,   lowerCamelCase :Optional[int] = 1			,   lowerCamelCase :Union[str, Any] = 512 * 9			,   lowerCamelCase :Optional[Any] = 512 * 3			,   lowerCamelCase :Any = 512			,   lowerCamelCase :str = 512			,   lowerCamelCase :str = 512			,   lowerCamelCase :int = 128			,   lowerCamelCase :Optional[Any] = 5			,   lowerCamelCase :List[str] = 1024			,   lowerCamelCase :List[str] = "multi_hop"			,   lowerCamelCase :Any = 512			,   lowerCamelCase :Any = False			,   lowerCamelCase :Any = 12			,   lowerCamelCase :Optional[int] = 768			,   lowerCamelCase :Tuple = 768			,   lowerCamelCase :Optional[int] = 32			,   lowerCamelCase :List[Any] = 0.1			,   lowerCamelCase :str = 0.1			,   lowerCamelCase :List[Any] = 0.0			,   lowerCamelCase :str = False			,   lowerCamelCase :Dict = False			,   lowerCamelCase :Union[str, Any] = False			,   lowerCamelCase :Union[str, Any] = "gelu"			,   lowerCamelCase :Optional[int] = None			,   lowerCamelCase :Optional[int] = False			,   lowerCamelCase :Optional[int] = 0			,   lowerCamelCase :Optional[int] = False			,   lowerCamelCase :Union[str, Any] = 0.0			,   lowerCamelCase :Optional[Any] = 8			,   lowerCamelCase :str = None			,   lowerCamelCase :str = None			,   lowerCamelCase :Optional[int] = True			,   lowerCamelCase :Tuple = True			,   lowerCamelCase :Union[str, Any]=0			,   lowerCamelCase :List[Any]=1			,   lowerCamelCase :int=2			,   **lowerCamelCase :Dict			,   )  ->      Optional[Any]:
       UpperCAmelCase__							=    num_classes
       UpperCAmelCase__							=    num_atoms
       UpperCAmelCase__							=    num_in_degree
       UpperCAmelCase__							=    num_out_degree
       UpperCAmelCase__							=    num_edges
       UpperCAmelCase__							=    num_spatial
       UpperCAmelCase__							=    num_edge_dis
       UpperCAmelCase__							=    edge_type
       UpperCAmelCase__							=    multi_hop_max_dist
       UpperCAmelCase__							=    spatial_pos_max
       UpperCAmelCase__							=    max_nodes
       UpperCAmelCase__							=    num_hidden_layers
       UpperCAmelCase__							=    embedding_dim
       UpperCAmelCase__							=    embedding_dim
       UpperCAmelCase__							=    ffn_embedding_dim
       UpperCAmelCase__							=    num_attention_heads
       UpperCAmelCase__							=    dropout
       UpperCAmelCase__							=    attention_dropout
       UpperCAmelCase__							=    layerdrop
       UpperCAmelCase__							=    encoder_normalize_before
       UpperCAmelCase__							=    pre_layernorm
       UpperCAmelCase__							=    apply_graphormer_init
       UpperCAmelCase__							=    activation_fn
       UpperCAmelCase__							=    embed_scale
       UpperCAmelCase__							=    freeze_embeddings
       UpperCAmelCase__							=    num_trans_layers_to_freeze
       UpperCAmelCase__							=    share_input_output_embed
       UpperCAmelCase__							=    traceable
       UpperCAmelCase__							=    q_noise
       UpperCAmelCase__							=    qn_block_size

       # These parameters are here for future extensions
       # atm, the model only supports self attention
       UpperCAmelCase__							=    kdim
       UpperCAmelCase__							=    vdim
       UpperCAmelCase__							=    self_attention
       UpperCAmelCase__							=    bias

       super().__init__(
           pad_token_id=_UpperCAmelCase			,   bos_token_id=_UpperCAmelCase			,   eos_token_id=_UpperCAmelCase			,   **_UpperCAmelCase			,   )













'''simple docstring'''







import re






def  lowerCAmelCase__		(					a_  :     Optional[int]			)   -> Optional[Any]:
       def docstring_decorator(a_  :     Dict			):
              UpperCAmelCase__	:   Optional[int]												=	fn.__doc__
              UpperCAmelCase__	:   Dict												=	func_doc.split('''\n'''			)
              UpperCAmelCase__	:   Any												=	0
              while i < len(a_			) and re.search(r'''^\s*Examples?:\s*$'''			,						lines[i]			) is None:
                     i += 1
              if i < len(a_			):
                     UpperCAmelCase__	:   List[Any]												=	example_docstring
                     UpperCAmelCase__	:   int												=	'''\n'''.join(a_			)
              else:
                     raise ValueError(
                         f"""The function {fn} should have an empty 'Examples:' in its docstring as placeholder, """
                         f"""current docstring is:\n{func_doc}"""			)
              UpperCAmelCase__	:   Any												=	func_doc
              return fn

       return docstring_decorator