MCPcopy Create free account

hub / github.com/mlco2/codecarbon / functions

Functions1,889 in github.com/mlco2/codecarbon

↓ 5 callersMethodfrom_ujoules
(cls, energy: float)
codecarbon/core/units.py:75
↓ 5 callersFunctiongenerate_lookup_value
(api_key: str)
carbonserver/carbonserver/api/infra/api_key_utils.py:34
↓ 5 callersFunctiongetDefaultDateRange
( months: number = 2, )
webapp/src/helpers/date-utils.ts:8
↓ 5 callersFunctionget_access_token
Return a valid access token, refreshing or failing with a clear message.
codecarbon/cli/auth.py:193
↓ 5 callersFunctionget_api_endpoint
(path: Optional[Path] = None)
codecarbon/cli/cli_utils.py:27
↓ 5 callersMethodget_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 callersMethodget_details
Fetches the CPU Power Details by fetching values from a logged csv file in _log_values function
codecarbon/core/powermetrics.py:157
↓ 5 callersMethodmap_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 callersFunctionnormalize_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 callersFunctionoverwrite_local_config
(config_name, value, path: Optional[Path] = None)
codecarbon/cli/cli_utils.py:69
↓ 5 callersFunctionreplace
(source, destination, variables)
deploy/deploy.py:46
↓ 5 callersMethodrevoke_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 callersMethodset_GPU_tracking
(self)
codecarbon/core/resource_tracker.py:222
↓ 5 callersMethodset_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 callersFunctionset_logger_format
(custom_preamble: Optional[str] = "")
codecarbon/external/logger.py:6
↓ 5 callersFunctionsetup_cloud_details_responses
(tested_provider, provider_metadata)
tests/test_cloud.py:27
↓ 5 callersMethodto_dict
(self)
codecarbon/output_methods/boamps/models.py:281
↓ 5 callersMethodwait
(self)
tests/cli/test_monitor.py:75
↓ 4 callersFunction_assert_env
(var: str)
carbonserver/tests/api/integration/test_auth_cookie_flow.py:57
↓ 4 callersFunction_get_candidate_bases
Get list of directories to scan for RAPL files.
codecarbon/core/cpu.py:47
↓ 4 callersMethod_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 callersMethod_get_memory_info
Returns memory info in bytes
codecarbon/core/gpu_amd.py:167
↓ 4 callersMethod_has_access
(self, desired_access: int, full_project_token: ProjectToken | None)
carbonserver/carbonserver/api/services/project_token_service.py:160
↓ 4 callersMethod_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 callersMethod_to_utf8
(self, str_or_bytes)
codecarbon/core/gpu_device.py:104
↓ 4 callersMethod_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 callersFunctionadd_emission
(run_id: str)
carbonserver/tests/api/integration/test_api_black_box.py:286
↓ 4 callersMethodadd_emission
(self, carbon_emission: dict)
codecarbon/core/api_client.py:199
↓ 4 callersMethodadd_emission
Send emissions data to push gateway
codecarbon/output_methods/metrics/prometheus.py:126
↓ 4 callersFunctionbuildLoginUrl
()
webapp/src/api/auth.ts:10
↓ 4 callersMethodcheck_jwt_user
(self, token: str | dict, create: bool)
carbonserver/carbonserver/api/services/signup_service.py:77
↓ 4 callersFunctiondecryptProjectId
(encrypted: string)
webapp/src/utils/crypto.ts:134
↓ 4 callersFunctiondownloadFile
* Helper function to download a file
webapp/src/utils/export.ts:176
↓ 4 callersMethodemit_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 callersMethodfrom_kgs_per_kWh
(cls, kgs_per_kWh: float)
codecarbon/core/units.py:48
↓ 4 callersFunctiongetSubtle
()
webapp/src/utils/crypto.ts:36
↓ 4 callersMethodget_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 callersMethodget_cpu_power_data
Returns CPU power Data. Data is pre-loaded at module import for performance.
codecarbon/input.py:183
↓ 4 callersFunctionheavy_computation
(run_time_secs: int = 3)
tests/test_emissions_tracker_constant.py:18
↓ 4 callersFunctionheavy_computation
(run_time_secs: int = 3)
tests/test_emissions_tracker_flush.py:15
↓ 4 callersFunctionisMockMode
()
webapp/src/api/mock/index.ts:3
↓ 4 callersMethodisOperationAuthorizedOnOrg
(self, organization_id, user: User)
carbonserver/carbonserver/api/services/auth_context.py:27
↓ 4 callersFunctionis_nvidia_system
Returns True if the system has an nvidia-smi interface.
codecarbon/core/gpu_nvidia.py:9
↓ 4 callersMethodkill
(self)
tests/cli/test_monitor.py:140
↓ 4 callersMethodmap_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 callersMethodmap_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 callersMethodmap_sql_to_schema
(organization: SqlModelOrganization)
carbonserver/carbonserver/api/infra/repositories/repository_organizations.py:186
↓ 4 callersFunctionmock_open
(*args, **kargs)
tests/testutils.py:10
↓ 4 callersFunctionquestionary_prompt
(prompt, list_options, default)
codecarbon/cli/main.py:440
↓ 4 callersFunctionread_energy
Read energy in microjoules
examples/rapl/test_rapl_domains.py:18
↓ 4 callersFunctionresolve_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 callersMethodstart
Starts tracking the experiment. Currently, Nvidia GPUs are supported. :return: None
codecarbon/emissions_tracker.py:660
↓ 4 callersMethodterminate
(self)
tests/cli/test_monitor.py:137
↓ 4 callersFunctionuseModal
(defaultOpen = false)
webapp/src/hooks/useModal.ts:10
↓ 4 callersMethodverify_custom_handler_state
( self, handler: CustomOutput, expected_lines=1 )
tests/test_custom_handler.py:65
↓ 3 callersFunction_check_energy_file
Check if energy file is readable and is a main domain.
codecarbon/core/cpu.py:90
↓ 3 callersMethod_create_run
Create the experiment for project_id
codecarbon/core/api_client.py:249
↓ 3 callersFunction_discover_endpoints
Fetch OpenID Connect discovery document.
codecarbon/cli/auth.py:77
↓ 3 callersMethod_exec_gpu_module
(self, import_func, check_output)
tests/test_gpu.py:30
↓ 3 callersMethod_get_cloud_metadata
:return: Metadata containing cloud info
codecarbon/emissions_tracker.py:1095
↓ 3 callersMethod_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 callersMethod_get_energy_kwh
(self)
codecarbon/core/gpu_device.py:41
↓ 3 callersMethod_get_gpu_ids
Get the Ids of the GPUs that we will monitor :return: list of ids
codecarbon/external/hardware.py:106
↓ 3 callersMethod_get_gpu_name
Returns the name of the GPU device
codecarbon/core/gpu_amd.py:149
↓ 3 callersMethod_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 callersMethod_get_power_limit
Returns max power usage in Watts
codecarbon/core/gpu_amd.py:226
↓ 3 callersMethod_get_power_usage
Returns power usage in Watts
codecarbon/core/gpu_amd.py:205
↓ 3 callersMethod_get_temperature
Returns degrees in the Celsius scale. Returns temperature in millidegrees Celsius.
codecarbon/core/gpu_amd.py:182
↓ 3 callersMethod_get_value
Reads the value in the file at the path
codecarbon/core/rapl.py:47
↓ 3 callersMethod_init_static_details
(self)
codecarbon/core/gpu_device.py:74
↓ 3 callersMethod_read_slurm_scontrol
(self)
codecarbon/external/ram.py:206
↓ 3 callersMethod_setup_cpu_load_mode
Set up CPU tracking in load mode using psutil.
codecarbon/core/resource_tracker.py:42
↓ 3 callersMethod_setup_fallback_tracking
Set up fallback CPU tracking using TDP estimation.
codecarbon/core/resource_tracker.py:120
↓ 3 callersMethodadd_telemetry
(self, telemetry: Optional[Union[TelemetryCreate, dict]] = None)
codecarbon/core/telemetry_client.py:25
↓ 3 callersFunctionbackup
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 callersFunctioncalculateConvertedValues
( radialChartData: RadialChartData, )
webapp/src/helpers/dashboard-calculations.ts:61
↓ 3 callersFunctioncalculateRadialChartData
( report: ExperimentReport[], )
webapp/src/helpers/dashboard-calculations.ts:24
↓ 3 callersMethodcan_read_project
(self, project_id: UUID, user: Optional[User])
carbonserver/carbonserver/api/services/auth_context.py:35
↓ 3 callersMethodcan_read_project
(*args, **kwargs)
carbonserver/tests/api/mocks.py:39
↓ 3 callersFunctionclean_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 callersFunctioncopyBytes
(view: Uint8Array)
webapp/src/utils/crypto.ts:52
↓ 3 callersMethodcreate_user
(self, user: UserAutoCreate)
carbonserver/carbonserver/api/services/user_service.py:11
↓ 3 callersMethoddelta
Compute the energy used since last call.
codecarbon/core/rapl.py:70
↓ 3 callersFunctiongetDefaultConvertedValues
()
webapp/src/helpers/dashboard-calculations.ts:89
↓ 3 callersFunctiongetDefaultRadialChartData
()
webapp/src/helpers/dashboard-calculations.ts:78
↓ 3 callersFunctiongetOneProject
( projectId: string, )
webapp/src/api/projects.ts:39
↓ 3 callersFunctiongetPayloadConfigFromPayload
( config: ChartConfig, payload: unknown, key: string, )
webapp/src/components/ui/chart.tsx:362
↓ 3 callersMethodget_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 callersMethodget_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 callersFunctionget_datetime
()
carbonserver/tests/api/integration/test_api_black_box.py:59
↓ 3 callersFunctionget_datetime_with_timezone
()
codecarbon/core/api_client.py:28
↓ 3 callersMethodget_global_emissions_choropleth_data
( self, net_energy_consumed: float )
codecarbon/viz/data.py:98
↓ 3 callersMethodget_list_organizations
List all organizations
codecarbon/core/api_client.py:94
↓ 3 callersMethodget_project_data
(df: pd.DataFrame, project_name: str)
codecarbon/viz/data.py:17
↓ 3 callersFunctionget_test_data_source
()
tests/testutils.py:19
↓ 3 callersMethodget_user_by_id
(self, user_id: str)
carbonserver/carbonserver/api/services/user_service.py:19
↓ 3 callersFunctionheavy_computation
(run_time_secs: int = 3)
tests/test_logging_output.py:16
↓ 3 callersFunctionis_gpu_details_available
Returns True if the GPU details are available.
codecarbon/core/gpu.py:164
↓ 3 callersFunctionis_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 callersFunctionis_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
← previousnext →101–200 of 1,889, ranked by callers