Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mlco2/codecarbon
/ functions
Functions
1,889 in github.com/mlco2/codecarbon
⨍
Functions
1,889
◇
Types & classes
328
↳
Endpoints
162
↓ 5 callers
Method
from_ujoules
(cls, energy: float)
codecarbon/core/units.py:75
↓ 5 callers
Function
generate_lookup_value
(api_key: str)
carbonserver/carbonserver/api/infra/api_key_utils.py:34
↓ 5 callers
Function
getDefaultDateRange
( months: number = 2, )
webapp/src/helpers/date-utils.ts:8
↓ 5 callers
Function
get_access_token
Return a valid access token, refreshing or failing with a clear message.
codecarbon/cli/auth.py:193
↓ 5 callers
Function
get_api_endpoint
(path: Optional[Path] = None)
codecarbon/cli/cli_utils.py:27
↓ 5 callers
Method
get_cloud_emissions
Computes emissions for cloud infra :param energy: Mean power consumption of the process (kWh) :param cloud: Region of compute
codecarbon/core/emissions.py:50
↓ 5 callers
Method
get_details
Fetches the CPU Power Details by fetching values from a logged csv file in _log_values function
codecarbon/core/powermetrics.py:157
↓ 5 callers
Method
map_sql_to_schema
Convert a models.Run to a schemas.Run :emission: An Run in SQLAlchemy format. :returns: An Run in pyDantic BaseModel format.
carbonserver/carbonserver/api/infra/repositories/repository_runs.py:93
↓ 5 callers
Function
normalize_gpu_ids
Normalize GPU IDs from config/user input into a list of ids consumable by hardware resolution code. Supports: - comma-separated stri
codecarbon/core/config.py:76
↓ 5 callers
Function
overwrite_local_config
(config_name, value, path: Optional[Path] = None)
codecarbon/cli/cli_utils.py:69
↓ 5 callers
Function
replace
(source, destination, variables)
deploy/deploy.py:46
↓ 5 callers
Method
revoke_token
Revoke an access token at the OIDC provider (RFC 7009). Best-effort — logs and swallows errors so logout always succeeds.
carbonserver/carbonserver/api/services/auth_providers/oidc_auth_provider.py:67
↓ 5 callers
Method
set_GPU_tracking
(self)
codecarbon/core/resource_tracker.py:222
↓ 5 callers
Method
set_access_token
This method sets the access token to be used for the API. Args: token (str): access token to be used for the API
codecarbon/core/api_client.py:75
↓ 5 callers
Function
set_logger_format
(custom_preamble: Optional[str] = "")
codecarbon/external/logger.py:6
↓ 5 callers
Function
setup_cloud_details_responses
(tested_provider, provider_metadata)
tests/test_cloud.py:27
↓ 5 callers
Method
to_dict
(self)
codecarbon/output_methods/boamps/models.py:281
↓ 5 callers
Method
wait
(self)
tests/cli/test_monitor.py:75
↓ 4 callers
Function
_assert_env
(var: str)
carbonserver/tests/api/integration/test_auth_cookie_flow.py:57
↓ 4 callers
Function
_get_candidate_bases
Get list of directories to scan for RAPL files.
codecarbon/core/cpu.py:47
↓ 4 callers
Method
_get_gpu_metrics_info
Helper function to get all GPU metrics at once, to minimize the number of calls to amdsmi and reduce the risk of hitting not initialized error
codecarbon/core/gpu_amd.py:101
↓ 4 callers
Method
_get_memory_info
Returns memory info in bytes
codecarbon/core/gpu_amd.py:167
↓ 4 callers
Method
_has_access
(self, desired_access: int, full_project_token: ProjectToken | None)
carbonserver/carbonserver/api/services/project_token_service.py:160
↓ 4 callers
Method
_import_gpu_amd_with_amdsmi_error
Simulate a fresh import of codecarbon.core.gpu_amd where importing amdsmi raises *error_to_raise*. Returns the freshly imported modu
tests/test_gpu_amd.py:401
↓ 4 callers
Method
_to_utf8
(self, str_or_bytes)
codecarbon/core/gpu_device.py:104
↓ 4 callers
Method
_verify_possible_tokens
Common function to verify the possible tokens and return the correct one if found Args: db_project_tokens (List[SqlModelProjectTo
carbonserver/carbonserver/api/infra/repositories/repository_projects_tokens.py:136
↓ 4 callers
Function
add_emission
(run_id: str)
carbonserver/tests/api/integration/test_api_black_box.py:286
↓ 4 callers
Method
add_emission
(self, carbon_emission: dict)
codecarbon/core/api_client.py:199
↓ 4 callers
Method
add_emission
Send emissions data to push gateway
codecarbon/output_methods/metrics/prometheus.py:126
↓ 4 callers
Function
buildLoginUrl
()
webapp/src/api/auth.ts:10
↓ 4 callers
Method
check_jwt_user
(self, token: str | dict, create: bool)
carbonserver/carbonserver/api/services/signup_service.py:77
↓ 4 callers
Function
decryptProjectId
(encrypted: string)
webapp/src/utils/crypto.ts:134
↓ 4 callers
Function
downloadFile
* Helper function to download a file
webapp/src/utils/export.ts:176
↓ 4 callers
Method
emit_selection_warning
Hook for backend-specific warnings when a GPU is explicitly selected. Backends that need to emit warnings for selected devices should overrid
codecarbon/core/gpu_device.py:110
↓ 4 callers
Method
from_kgs_per_kWh
(cls, kgs_per_kWh: float)
codecarbon/core/units.py:48
↓ 4 callers
Function
getSubtle
()
webapp/src/utils/crypto.ts:36
↓ 4 callers
Method
get_country_emissions_data
Returns Emissions Across Regions in a country. Data is cached on first access per country. :param country_iso_code: ISO code
codecarbon/input.py:144
↓ 4 callers
Method
get_cpu_power_data
Returns CPU power Data. Data is pre-loaded at module import for performance.
codecarbon/input.py:183
↓ 4 callers
Function
heavy_computation
(run_time_secs: int = 3)
tests/test_emissions_tracker_constant.py:18
↓ 4 callers
Function
heavy_computation
(run_time_secs: int = 3)
tests/test_emissions_tracker_flush.py:15
↓ 4 callers
Function
isMockMode
()
webapp/src/api/mock/index.ts:3
↓ 4 callers
Method
isOperationAuthorizedOnOrg
(self, organization_id, user: User)
carbonserver/carbonserver/api/services/auth_context.py:27
↓ 4 callers
Function
is_nvidia_system
Returns True if the system has an nvidia-smi interface.
codecarbon/core/gpu_nvidia.py:9
↓ 4 callers
Method
kill
(self)
tests/cli/test_monitor.py:140
↓ 4 callers
Method
map_sql_to_schema
Convert a models.Project to a schemas.Project :project: An Project in SQLAlchemy format. :returns: An Project in pyDantic BaseModel f
carbonserver/carbonserver/api/infra/repositories/repository_projects.py:197
↓ 4 callers
Method
map_sql_to_schema
Sql To Pydantic Mapper :returns: An User in pyDantic BaseModel format. :rtype: schemas.User
carbonserver/carbonserver/api/infra/repositories/repository_users.py:155
↓ 4 callers
Method
map_sql_to_schema
(organization: SqlModelOrganization)
carbonserver/carbonserver/api/infra/repositories/repository_organizations.py:186
↓ 4 callers
Function
mock_open
(*args, **kargs)
tests/testutils.py:10
↓ 4 callers
Function
questionary_prompt
(prompt, list_options, default)
codecarbon/cli/main.py:440
↓ 4 callers
Function
read_energy
Read energy in microjoules
examples/rapl/test_rapl_domains.py:18
↓ 4 callers
Function
resolve_path
Fully resolve a path: resolve env vars ($HOME etc.) -> expand user (~) -> make absolute Args: path (Union[str, Path]): Path to a
codecarbon/core/util.py:34
↓ 4 callers
Method
start
Starts tracking the experiment. Currently, Nvidia GPUs are supported. :return: None
codecarbon/emissions_tracker.py:660
↓ 4 callers
Method
terminate
(self)
tests/cli/test_monitor.py:137
↓ 4 callers
Function
useModal
(defaultOpen = false)
webapp/src/hooks/useModal.ts:10
↓ 4 callers
Method
verify_custom_handler_state
( self, handler: CustomOutput, expected_lines=1 )
tests/test_custom_handler.py:65
↓ 3 callers
Function
_check_energy_file
Check if energy file is readable and is a main domain.
codecarbon/core/cpu.py:90
↓ 3 callers
Method
_create_run
Create the experiment for project_id
codecarbon/core/api_client.py:249
↓ 3 callers
Function
_discover_endpoints
Fetch OpenID Connect discovery document.
codecarbon/cli/auth.py:77
↓ 3 callers
Method
_exec_gpu_module
(self, import_func, check_output)
tests/test_gpu.py:30
↓ 3 callers
Method
_get_cloud_metadata
:return: Metadata containing cloud info
codecarbon/emissions_tracker.py:1095
↓ 3 callers
Method
_get_compute_processes
Returns the list of processes ids having a compute context on the device with the memory used
codecarbon/core/gpu_amd.py:250
↓ 3 callers
Method
_get_energy_kwh
(self)
codecarbon/core/gpu_device.py:41
↓ 3 callers
Method
_get_gpu_ids
Get the Ids of the GPUs that we will monitor :return: list of ids
codecarbon/external/hardware.py:106
↓ 3 callers
Method
_get_gpu_name
Returns the name of the GPU device
codecarbon/core/gpu_amd.py:149
↓ 3 callers
Method
_get_graphics_processes
Returns the list of processes ids having a graphics context on the device with the memory used
codecarbon/core/gpu_amd.py:260
↓ 3 callers
Method
_get_power_limit
Returns max power usage in Watts
codecarbon/core/gpu_amd.py:226
↓ 3 callers
Method
_get_power_usage
Returns power usage in Watts
codecarbon/core/gpu_amd.py:205
↓ 3 callers
Method
_get_temperature
Returns degrees in the Celsius scale. Returns temperature in millidegrees Celsius.
codecarbon/core/gpu_amd.py:182
↓ 3 callers
Method
_get_value
Reads the value in the file at the path
codecarbon/core/rapl.py:47
↓ 3 callers
Method
_init_static_details
(self)
codecarbon/core/gpu_device.py:74
↓ 3 callers
Method
_read_slurm_scontrol
(self)
codecarbon/external/ram.py:206
↓ 3 callers
Method
_setup_cpu_load_mode
Set up CPU tracking in load mode using psutil.
codecarbon/core/resource_tracker.py:42
↓ 3 callers
Method
_setup_fallback_tracking
Set up fallback CPU tracking using TDP estimation.
codecarbon/core/resource_tracker.py:120
↓ 3 callers
Method
add_telemetry
(self, telemetry: Optional[Union[TelemetryCreate, dict]] = None)
codecarbon/core/telemetry_client.py:25
↓ 3 callers
Function
backup
Resolves the path to a path then backs it up, adding the extension provided. Warning : this function will rename the file in place, it's the
codecarbon/core/util.py:49
↓ 3 callers
Function
calculateConvertedValues
( radialChartData: RadialChartData, )
webapp/src/helpers/dashboard-calculations.ts:61
↓ 3 callers
Function
calculateRadialChartData
( report: ExperimentReport[], )
webapp/src/helpers/dashboard-calculations.ts:24
↓ 3 callers
Method
can_read_project
(self, project_id: UUID, user: Optional[User])
carbonserver/carbonserver/api/services/auth_context.py:35
↓ 3 callers
Method
can_read_project
(*args, **kwargs)
carbonserver/tests/api/mocks.py:39
↓ 3 callers
Function
clean_env_key
Clean up an environment variable key: remove starting CODECARBON_ and to lower case. eg: "CODECARBON_PROJECT_NAME" -> "project_name"
codecarbon/core/config.py:9
↓ 3 callers
Function
copyBytes
(view: Uint8Array)
webapp/src/utils/crypto.ts:52
↓ 3 callers
Method
create_user
(self, user: UserAutoCreate)
carbonserver/carbonserver/api/services/user_service.py:11
↓ 3 callers
Method
delta
Compute the energy used since last call.
codecarbon/core/rapl.py:70
↓ 3 callers
Function
getDefaultConvertedValues
()
webapp/src/helpers/dashboard-calculations.ts:89
↓ 3 callers
Function
getDefaultRadialChartData
()
webapp/src/helpers/dashboard-calculations.ts:78
↓ 3 callers
Function
getOneProject
( projectId: string, )
webapp/src/api/projects.ts:39
↓ 3 callers
Function
getPayloadConfigFromPayload
( config: ChartConfig, payload: unknown, key: string, )
webapp/src/components/ui/chart.tsx:362
↓ 3 callers
Method
get_country_energy_mix_data
Returns Energy Mix Across Regions in a country. Data is cached on first access per country. :param country_iso_code: ISO cod
codecarbon/input.py:162
↓ 3 callers
Method
get_cpu_details
Fetches the CPU Power Details by fetching values from a logged csv file in _log_values function
codecarbon/core/cpu.py:361
↓ 3 callers
Function
get_datetime
()
carbonserver/tests/api/integration/test_api_black_box.py:59
↓ 3 callers
Function
get_datetime_with_timezone
()
codecarbon/core/api_client.py:28
↓ 3 callers
Method
get_global_emissions_choropleth_data
( self, net_energy_consumed: float )
codecarbon/viz/data.py:98
↓ 3 callers
Method
get_list_organizations
List all organizations
codecarbon/core/api_client.py:94
↓ 3 callers
Method
get_project_data
(df: pd.DataFrame, project_name: str)
codecarbon/viz/data.py:17
↓ 3 callers
Function
get_test_data_source
()
tests/testutils.py:19
↓ 3 callers
Method
get_user_by_id
(self, user_id: str)
carbonserver/carbonserver/api/services/user_service.py:19
↓ 3 callers
Function
heavy_computation
(run_time_secs: int = 3)
tests/test_logging_output.py:16
↓ 3 callers
Function
is_gpu_details_available
Returns True if the GPU details are available.
codecarbon/core/gpu.py:164
↓ 3 callers
Function
is_key_all_values_equal
Check if all values of a key are equal to the specified value.
carbonserver/tests/api/integration/test_api_black_box.py:83
↓ 3 callers
Function
is_powergadget_available
Checks if Intel Power Gadget is available on the system. Returns: bool: `True` if Intel Power Gadget is available, `False` otherwise
codecarbon/core/cpu.py:28
← previous
next →
101–200 of 1,889, ranked by callers