



'''simple docstring'''

# Lint as: python3
import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


__lowerCAmelCase						      =       re.compile(r'''^(?P<major>\d+)''' r'''\.(?P<minor>\d+)''' r'''\.(?P<patch>\d+)$''')

@total_ordering
@dataclass
class      __magic_name__						:
							lowerCAmelCase	:   str
							lowerCAmelCase	:   Optional[str]           = None
							lowerCAmelCase	:   Optional[Union[str, int]]           = None
							lowerCAmelCase	:   Optional[Union[str, int]]           = None
							lowerCAmelCase	:   Optional[Union[str, int]]           = None







							def 							__lowercase      (							self :	Optional[int]		):
									_a	, _a	, _a					:				int				=							_str_to_version_tuple(self.version_str		)







							def __repr__(							self :	Union[str, Any]		):
									return F"""{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}"""







							@property
							def 							__lowercase      (							self :	Union[str, Any]		):
									return self.major, self.minor, self.patch







							def 							__lowercase      (							self :	Dict     ,_UpperCAmelCase :	Tuple		):
									if isinstance(_UpperCAmelCase     ,_UpperCAmelCase		):
											return Version(_UpperCAmelCase		)
									elif isinstance(_UpperCAmelCase     ,_UpperCAmelCase		):
											return other
									raise TypeError(F"""{other} (type {type(_UpperCAmelCase		)}) cannot be compared to version."""		)







							def __eq__(							self :	List[str]     ,_UpperCAmelCase :	int		):
									try:
											_a					:				Tuple				=							self._validate_operand(_UpperCAmelCase		)
									except (TypeError, ValueError):
											return False
									else:
											return self.tuple == other.tuple







							def __lt__(							self :	str     ,_UpperCAmelCase :	Optional[int]		):
									_a					:				Tuple				=							self._validate_operand(_UpperCAmelCase		)
									return self.tuple < other.tuple







							def __hash__(							self :	List[str]		):
									return hash(_version_tuple_to_str(self.tuple		)		)







							@classmethod
							def 							__lowercase      (							cls :	Any     ,_UpperCAmelCase :	int		):
									_a					:				Optional[int]				=							{f.name for f in dataclasses.fields(cls		)}
									return cls(**{k: v for k, v in dic.items() if k in field_names}		)







							def 							__lowercase      (							self :	List[str]		):
									return self.version_str



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				Dict:
		_a					:				List[str]				=							_VERSION_REG.match(lowerCAmelCase_  )
		if not res:
				raise ValueError(f"""Invalid version '{version_str}'. Format should be x.y.z with {{x,y,z}} being digits."""  )
		return tuple(int(lowerCAmelCase_  ) for v in [res.group('major'  ), res.group('minor'  ), res.group('patch'  )]  )



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				Tuple:
		return ".".join(str(lowerCAmelCase_  ) for v in version_tuple  )









'''simple docstring'''

from __future__ import annotations

import os
from typing import Any

import requests

__lowerCAmelCase						      =       '''https://api.github.com'''

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

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



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				dict[Any, Any]:
		_a					:				Union[str, Any]				=							{
		    'Authorization': f"""token {auth_token}""",
		    'Accept': 'application/vnd.github.v3+json',
		}
		return requests.get(lowerCAmelCase_						,      headers=lowerCAmelCase_  ).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.''')




