MCPcopy Create free account
hub / github.com/modelscope/modelscope / get_user_info

Method get_user_info

modelscope/hub/api.py:387–397  ·  view source on GitHub ↗

Return ``(username, email)`` previously saved, or ``(None, None)``.

()

Source from the content-addressed store, hash-verified

385
386 @staticmethod
387 def get_user_info() -> Tuple[Optional[str], Optional[str]]:
388 """Return ``(username, email)`` previously saved, or ``(None, None)``."""
389 path = get_default_config().credentials_dir / ModelScopeConfig.USER_INFO_FILE_NAME
390 try:
391 info = path.read_text(encoding='utf-8')
392 except (FileNotFoundError, OSError):
393 return None, None
394 parts = info.split(':', 1)
395 if len(parts) == 2:
396 return parts[0], parts[1]
397 return None, None
398
399 @staticmethod
400 def get_git_token() -> Optional[str]:

Callers 4

_whoamiFunction · 0.80
_authorizeMethod · 0.80
add_user_infoMethod · 0.80
setUpMethod · 0.80

Calls 2

get_default_configFunction · 0.90
read_textMethod · 0.45

Tested by 1

setUpMethod · 0.64