MCPcopy Create free account
hub / github.com/mlco2/codecarbon / check_auth

Method check_auth

codecarbon/core/api_client.py:82–92  ·  view source on GitHub ↗

Check API access to user account

(self)

Source from the content-addressed store, hash-verified

80 self.access_token = token
81
82 def check_auth(self):
83 """
84 Check API access to user account
85 """
86 url = self.url + "/auth/check"
87 headers = self._get_headers()
88 r = requests.get(url=url, timeout=2, headers=headers)
89 if r.status_code != 200:
90 self._log_error(url, {}, r)
91 return None
92 return r.json()
93
94 def get_list_organizations(self):
95 """

Callers 2

loginFunction · 0.95

Calls 3

_get_headersMethod · 0.95
_log_errorMethod · 0.95
jsonMethod · 0.80

Tested by 1