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
Method
test_cloud_metadata_GCP_empty
(self, mock_get_env_cloud_details)
tests/test_geography.py:65
Method
test_cloud_uses_forced_intensity_when_set
(self)
tests/test_emissions.py:200
Method
test_codecarbon_api_live_out
(self)
tests/output_methods/test_http.py:139
Method
test_codecarbon_api_out
(self)
tests/output_methods/test_http.py:162
Method
test_codecarbon_api_output_initialization
(self)
tests/output_methods/test_http.py:131
Method
test_codecarbon_live_out_api_call_failure
(self, mock_logger)
tests/output_methods/test_http.py:151
Method
test_codecarbon_out_api_call_failure
(self, mock_logger)
tests/output_methods/test_http.py:174
Method
test_config_no_local_new_all
( self, mock_typer_prompt, mock_token, mock_prompt, mock_confirm,
tests/cli/test_cli.py:62
Method
test_context_file_lifecycle
Full lifecycle using from_file() constructor.
tests/test_boamps_output.py:1122
Method
test_context_file_task_overrides
Context file task values are preserved.
tests/test_boamps_output.py:839
Method
test_context_with_environment_overrides
Environment fields from context file are applied as overrides.
tests/test_boamps_output.py:906
Method
test_context_with_infrastructure_overrides
Infrastructure fields from context file are applied as overrides.
tests/test_boamps_output.py:880
Method
test_context_with_user_components
User-provided components enrich auto-detected ones.
tests/test_boamps_output.py:932
Function
test_core_and_server_telemetry_schemas_do_not_drift
()
carbonserver/tests/api/test_telemetry_schema_drift.py:40
Function
test_count_cpus_no_slurm
()
tests/test_core_util.py:99
Function
test_count_cpus_slurm
()
tests/test_core_util.py:105
Function
test_count_cpus_slurm_exception
()
tests/test_core_util.py:123
Function
test_count_cpus_slurm_malformed
()
tests/test_core_util.py:135
Function
test_count_cpus_slurm_no_gpu
()
tests/test_core_util.py:114
Function
test_count_cpus_slurm_too_many_matches
()
tests/test_core_util.py:145
Method
test_count_physical_cpus_linux
(self)
tests/test_cpu.py:869
Method
test_count_physical_cpus_windows
(self)
tests/test_cpu.py:834
Method
test_count_physical_cpus_windows_with_error
(self)
tests/test_cpu.py:847
Method
test_country_data_lazy_loaded
Verify country-specific data is lazy-loaded and cached.
tests/test_input.py:70
Function
test_country_specific_data_access
Test that we can access country-specific data if available.
tests/test_package_integrity.py:85
Method
test_cpu_calculate_power_from_cpu_load_linear
( self, mocked_is_psutil_available, mocked_is_powergadget_available, mocked_is
tests/test_cpu_load.py:98
Method
test_cpu_calculate_power_from_cpu_load_threadripper
( self, mocked_is_psutil_available, mocked_is_powergadget_available, mocked_is
tests/test_cpu_load.py:71
Method
test_cpu_component_details
cpu_count (threads) is halved to approximate physical cores.
tests/test_boamps_output.py:355
Method
test_cpu_load_detection
( self, mocked_is_psutil_available, mocked_is_powergadget_available, mocked_is
tests/test_cpu_load.py:52
Function
test_cpu_power_data_included
Test that CPU power data is included.
tests/test_package_integrity.py:43
Method
test_cpu_total_power
( self, mocked_is_psutil_available, mocked_is_powergadget_available, mocked_is
tests/test_cpu_load.py:36
Method
test_cpu_total_power_averages_buffered_and_latest_sample
( self, mocked_get_power_from_cpus, mocked_is_psutil_available, mocked_is_powe
tests/test_cpu_load.py:172
Method
test_cpu_total_power_empty_history
Regression test for issue #832: ZeroDivisionError when no power samples collected.
tests/test_cpu_load.py:129
Method
test_cpu_total_power_fetches_sample_when_history_is_empty
Calling total_power should always fetch the latest sample before averaging.
tests/test_cpu_load.py:151
Method
test_cpu_total_power_process
( self, mocked_is_psutil_available, mocked_is_powergadget_available, mocked_is
tests/test_cpu_load.py:14
Method
test_cpu_utilization_as_fraction
cpu_utilization_percent is converted to 0-1 range.
tests/test_boamps_output.py:327
Function
test_create_new_config_file_creates_parent_and_file
(monkeypatch, tmp_path)
tests/cli/test_cli_utils.py:78
Function
test_create_new_config_file_expands_home
(monkeypatch, tmp_path)
tests/cli/test_cli_utils.py:94
Method
test_create_organization_skips_when_name_exists
(self)
tests/test_api_call.py:161
Method
test_create_run_returns_none_on_unsuccessful_status
(self)
tests/test_api_call.py:256
Function
test_critical_data_files_included
Test that all critical data files are included in the package.
tests/test_package_integrity.py:14
Method
test_cuda_visible_devices_takes_precedence_over_rocr_visible_devices
(self)
tests/test_config.py:385
Method
test_cumulative_emissions_with_varying_intensity
( self, mock_scheduler, mock_get_hw, mock_resource_tracker, mock_get,
tests/test_emissions_tracker.py:859
Function
test_data_cleanup
Cleanup test data after test execution.
carbonserver/tests/api/integration/test_project_cascade_delete.py:47
Method
test_dataset_from_dict
(self)
tests/test_boamps_output.py:990
Method
test_dataset_serialization
(self)
tests/test_boamps_output.py:162
Method
test_decorator_OFFLINE_NO_COUNTRY
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:416
Method
test_decorator_OFFLINE_WITH_CLOUD_ARGS
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:457
Method
test_decorator_OFFLINE_WITH_LOC_ARGS
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:433
Method
test_decorator_ONLINE_NO_ARGS
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:332
Method
test_decorator_ONLINE_WITH_ARGS
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:360
Method
test_decorator_constant
(self)
tests/test_emissions_tracker_constant.py:123
Method
test_decorator_flush
(self)
tests/test_logging_output.py:80
Method
test_decorator_flush
(self)
tests/test_custom_handler.py:47
Method
test_decorator_flush
(self)
tests/test_emissions_tracker_flush.py:72
Method
test_decorator_online_passes_output_methods
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:387
Method
test_default_output_methods_is_csv
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:238
Function
test_delete_nonexistent_project_returns_error
Test that attempting to delete a non-existent project returns appropriate error.
carbonserver/tests/api/routers/test_projects.py:147
Function
test_delete_project
(client, custom_test_server)
carbonserver/tests/api/routers/test_projects.py:118
Function
test_delete_project_cascades_to_children
Test that deleting a project through the router calls the repository delete, which will cascade to all child entities (experiments, runs, emi
carbonserver/tests/api/routers/test_projects.py:129
Function
test_delete_project_token
(client, custom_test_server)
carbonserver/tests/api/routers/test_project_tokens.py:81
Function
test_detailed_sum_computes_for_experiment_id
()
carbonserver/tests/api/usecase/run/test_experiment_sum_by_run_usecase.py:34
Function
test_detailed_sum_computes_for_project_id
()
carbonserver/tests/api/usecase/experiment/test_project_global_sum_by_experiment_usecase.py:58
Method
test_detect_arm_cpu
Test ARM CPU detection logic
tests/test_ram.py:253
Function
test_detect_cpu_model_caching
Test that detect_cpu_model() results are cached.
tests/test_core_util.py:16
Function
test_detect_monkeypatched_tracker
(monkeypatch)
tests/cli/test_cli_main.py:72
Function
test_disabled_telemetry_is_rejected
(client, custom_test_server)
carbonserver/tests/api/routers/test_telemetry.py:69
Method
test_discover_endpoints
(self, mock_get)
tests/cli/test_cli_auth.py:66
Method
test_do_get_error
(self)
tests/cli/test_cli_auth.py:49
Method
test_do_get_success
(self)
tests/cli/test_cli_auth.py:35
Function
test_doc_python_blocks
Test independent Python code blocks from docs. Each block runs in isolation (memory=False). CWD is changed to tmp_path to isolate any file I/
tests/test_docs_examples.py:27
Function
test_emission_service_creates_correct_emission
(_)
carbonserver/tests/api/service/test_experiments_service.py:60
Function
test_emission_service_creates_correct_emission
(_)
carbonserver/tests/api/service/test_emission_service.py:66
Function
test_emission_service_retrieves_all_existing_emissions_for_one_run
()
carbonserver/tests/api/service/test_experiments_service.py:77
Function
test_emission_service_retrieves_all_existing_emissions_for_one_run
()
carbonserver/tests/api/service/test_emission_service.py:92
Function
test_emission_service_retrives_correct_emission_by_id
()
carbonserver/tests/api/service/test_experiments_service.py:100
Function
test_emission_service_retrives_correct_emission_by_id
()
carbonserver/tests/api/service/test_emission_service.py:106
Method
test_emissions_CLOUD_AZURE
(self)
tests/test_emissions.py:29
Method
test_emissions_CLOUD_GCP
(self)
tests/test_emissions.py:40
Method
test_emissions_co2_signal_api_token_deprecated
Test that co2_signal_api_token still works in Emissions class.
tests/test_electricitymaps_backward_compatibility.py:16
Method
test_emissions_new_parameter_takes_precedence
Test that new parameter takes precedence over old one.
tests/test_electricitymaps_backward_compatibility.py:33
Method
test_emissions_tracker_unsupported_gpu
(self, mock_pynvml)
tests/test_unsupported_gpu.py:27
Method
test_emit_selection_warning_noop_when_not_dual_gcd
(self)
tests/test_gpu_amd.py:179
Method
test_empty_conf
(self)
tests/test_config.py:177
Method
test_environment_mapping
country_name, latitude, longitude map to environment.
tests/test_boamps_output.py:432
Method
test_environment_overrides
Environment overrides are applied.
tests/test_boamps_output.py:499
Method
test_estimate_dimm_count
Test DIMM count estimation based on RAM size
tests/test_ram.py:270
Method
test_exit_method
(self, mock_delete)
tests/output_methods/metrics/test_prometheus.py:55
Function
test_extends_emissions_units
()
tests/test_viz_units.py:22
Function
test_fetch_org_users
(client, custom_test_server)
carbonserver/tests/api/routers/test_organizations.py:163
Function
test_fief_cookie_and_bearer_flow
()
carbonserver/tests/api/integration/test_auth_cookie_flow.py:94
Method
test_file_handler_preserved_after_set_logger_format
A FileHandler added by the user must survive a call to set_logger_format().
tests/test_logger.py:18
Method
test_file_output_initialization
(self)
tests/output_methods/test_file.py:56
Method
test_file_output_initialization_invalid_csv_write_mode
(self)
tests/output_methods/test_file.py:59
Method
test_file_output_initialization_invalid_dir
(self)
tests/output_methods/test_file.py:63
Method
test_file_output_out_append_empty_file_exists
(self)
tests/output_methods/test_file.py:176
Method
test_file_output_out_append_file_exists
(self)
tests/output_methods/test_file.py:127
Method
test_file_output_out_append_no_file_exists
(self)
tests/output_methods/test_file.py:120
Method
test_file_output_out_append_no_gpu_consistent_columns
Regression test: successive appends with gpu_count=None/gpu_model=None must never trigger a format-change warning or produce a .bak backup fil
tests/output_methods/test_file.py:200
Method
test_file_output_out_append_no_gpu_zero_defaults
Test that gpu_count=0 and gpu_model="" (the new tracker defaults for CPU-only machines) produce consistent CSV columns across successive write
tests/output_methods/test_file.py:269
← previous
next →
1,301–1,400 of 1,889, ranked by callers