"""simple docstring"""







import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel

class 		UpperCamelCase      (   lowercase						):
				UpperCAmelCase    :				Dict   =		"""M-CLIP"""



				def __init__(self    :				Optional[int]     ,  _A    :				Optional[int]=10_24     ,  _A    :				Union[str, Any]=7_68     ,  **_A    :				Any)   ->     Dict:
					__snake_case      :							Dict						=			transformerDimSize
					__snake_case      :							Any						=			imageDimSize
					super().__init__(**_A)







class 		UpperCamelCase      (   lowercase						):
				UpperCAmelCase    :				List[str]   =		MCLIPConfig



				def __init__(self    :				List[Any]     ,  _A    :				int     ,  *_A    :				List[Any]     ,  **_A    :				Union[str, Any])   ->     Optional[Any]:
					super().__init__(_A     ,  *_A     ,  **_A)
					__snake_case      :							str						=			XLMRobertaModel(_A)
					__snake_case      :							Dict						=			torch.nn.Linear(
					    in_features=config.transformerDimensions     ,  out_features=config.numDims)






				def  _lowercase					(self    :				Any     ,  _A    :				str     ,  _A    :				Optional[int])   ->     List[str]:
					__snake_case      :							List[str]						=			self.transformer(input_ids=_A     ,  attention_mask=_A)[0]
					__snake_case      :							str						=			(embs * attention_mask.unsqueeze(2)).sum(dim=1) / attention_mask.sum(dim=1)[:, None]
					return self.LinearTransformation(_A), embs






"""simple docstring"""







from __future__ import annotations

import os
from typing import Any

import requests

_a					:					int=			"https://api.github.com"

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

# https://github.com/settings/tokens
_a					:					Union[str, Any]=			os.environ.get("USER_TOKEN", "")
def   __UpperCAmelCase    (   UpperCAmelCase_   :    str  )							->      dict[Any, Any]:

	'''simple docstring'''





	__snake_case      :							Tuple						=			{
	    'Authorization': F"token {auth_token}",
	    'Accept': 'application/vnd.github.v3+json',
	}
	return requests.get(UpperCAmelCase_      ,							headers=UpperCAmelCase_  ).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.")





