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

Method get_project

codecarbon/core/api_client.py:187–197  ·  view source on GitHub ↗

Get a project

(self, project_id)

Source from the content-addressed store, hash-verified

185 return r.json()
186
187 def get_project(self, project_id):
188 """
189 Get a project
190 """
191 url = self.url + "/projects/" + project_id
192 headers = self._get_headers()
193 r = requests.get(url=url, timeout=2, headers=headers)
194 if r.status_code != 200:
195 self._log_error(url, {}, r)
196 return None
197 return r.json()
198
199 def add_emission(self, carbon_emission: dict):
200 assert self.experiment_id is not None

Callers 1

show_configFunction · 0.95

Calls 3

_get_headersMethod · 0.95
_log_errorMethod · 0.95
jsonMethod · 0.80

Tested by

no test coverage detected