MCPcopy Create free account

hub / github.com/mlco2/codecarbon / functions

Functions1,889 in github.com/mlco2/codecarbon

Methodtest_file_output_out_file_exists_invalid_headers
(self, mock_has_valid_headers)
tests/output_methods/test_file.py:101
Methodtest_file_output_out_update_empty_file_exists
(self)
tests/output_methods/test_file.py:188
Methodtest_file_output_out_update_file_exists_multiple_matching_rows
(self)
tests/output_methods/test_file.py:146
Methodtest_file_output_out_update_file_exists_no_matching_row
(self)
tests/output_methods/test_file.py:135
Methodtest_file_output_out_update_file_exists_one_matchingrows
(self)
tests/output_methods/test_file.py:160
Methodtest_file_output_out_update_no_file_exists
(self)
tests/output_methods/test_file.py:113
Methodtest_file_output_task_out
(self)
tests/output_methods/test_file.py:332
Functiontest_first_tracking_tutorial
Test tutorial with sequential code blocks. The first-tracking.md tutorial has blocks that depend on each other: 1. Run tracker (creates emiss
tests/test_docs_examples.py:41
Methodtest_force_carbon_intensity_constructor_overrides_config
(self)
tests/test_config.py:237
Methodtest_force_carbon_intensity_rejects_negative_parameter
(self)
tests/test_config.py:268
Methodtest_force_carbon_intensity_rejects_non_numeric_parameter
(self)
tests/test_config.py:280
Methodtest_force_ram_power
Test that force_ram_power overrides automatic RAM power estimation
tests/test_ram.py:404
Methodtest_full_hierarchy
(self)
tests/test_config.py:197
Methodtest_full_lifecycle
BoAmpsOutput produces a valid report from EmissionsData.
tests/test_boamps_output.py:1082
Methodtest_full_mapping
Realistic EmissionsData maps to a complete BoAmps report.
tests/test_boamps_output.py:289
Methodtest_full_report_passes
Full report with all optional fields passes validation.
tests/test_boamps_output.py:698
Methodtest_full_report_serialization
Complete report with all sections serializes correctly.
tests/test_boamps_output.py:232
Methodtest_geo_metadata_CANADA
(self)
tests/test_geography.py:122
Methodtest_geo_metadata_USA
(self)
tests/test_geography.py:79
Methodtest_geo_metadata_USA_backup
(self)
tests/test_geography.py:87
Methodtest_geo_metadata_empty_region_fallback
(self)
tests/test_geography.py:103
Methodtest_get_access_token_raises_when_access_token_missing
(self, mock_load)
tests/cli/test_cli_auth.py:184
Methodtest_get_access_token_raises_when_credentials_missing
(self, mock_load)
tests/cli/test_cli_auth.py:179
Methodtest_get_access_token_refresh
( self, mock_save, mock_refresh, mock_validate, mock_load )
tests/cli/test_cli_auth.py:194
Methodtest_get_access_token_refresh_failure_deletes_credentials
( self, mock_load, mock_validate, mock_refresh )
tests/cli/test_cli_auth.py:209
Methodtest_get_access_token_valid
(self, mock_validate, mock_load)
tests/cli/test_cli_auth.py:173
Functiontest_get_api_endpoint_appends_default_when_missing_key
(tmp_path)
tests/cli/test_cli_utils.py:22
Functiontest_get_api_endpoint_returns_default_when_file_missing
(tmp_path)
tests/cli/test_cli_utils.py:34
Functiontest_get_api_key_uses_bearer_token
(monkeypatch)
tests/cli/test_cli_main.py:188
Methodtest_get_candidate_bases_for_custom_dir
(self)
tests/test_cpu.py:83
Methodtest_get_candidate_bases_for_default_dir_deduplicates_and_filters
(self)
tests/test_cpu.py:92
Methodtest_get_carbon_intensity_per_source_data
(self)
tests/test_emissions.py:50
Methodtest_get_carbon_intensity_returns_cached_data
Verify get_carbon_intensity_per_source_data() returns cached object.
tests/test_input.py:50
Methodtest_get_children_memories_reads_recursive_children
(self, mock_process)
tests/test_ram.py:182
Methodtest_get_cloud_emissions_returns_cached_data
Verify get_cloud_emissions_data() returns cached object.
tests/test_input.py:40
Methodtest_get_compute_and_graphics_processes
(self)
tests/test_gpu_amd.py:372
Functiontest_get_config_raises_when_missing
(tmp_path)
tests/cli/test_cli_utils.py:17
Functiontest_get_config_reads_codecarbon_section
(tmp_path)
tests/cli/test_cli_utils.py:8
Functiontest_get_country_choropleth_data
()
tests/test_viz_data.py:57
Methodtest_get_cpu_details
(self, mock_setup, mock_log_values)
tests/test_cpu.py:190
Methodtest_get_cpu_details_returns_empty_dict_on_read_error
( self, mock_setup, mock_read_csv, mock_log_values )
tests/test_cpu.py:299
Methodtest_get_cpu_power_from_registry
(self)
tests/test_cpu.py:365
Methodtest_get_cpu_power_from_registry_returns_none_without_match
(self)
tests/test_cpu.py:374
Methodtest_get_cpu_power_returns_cached_data
Verify get_cpu_power_data() returns cached object.
tests/test_input.py:60
Methodtest_get_details
(self, mock_setup, mock_log_values)
tests/test_powermetrics.py:35
Methodtest_get_details_returns_empty_dict_on_read_error
( self, mock_setup, mock_open, mock_log_values )
tests/test_powermetrics.py:156
Methodtest_get_detected_hardware
( self, mock_cli_setup, mock_log_values, mocked_get_gpu_details, mocke
tests/test_emissions_tracker.py:831
Methodtest_get_emissions_CLOUD_AWS
(self)
tests/test_emissions.py:17
Methodtest_get_emissions_PRIVATE_INFRA_CANADA_WITHOUT_REGION
(self)
tests/test_emissions.py:139
Methodtest_get_emissions_PRIVATE_INFRA_CANADA_WITH_REGION
(self)
tests/test_emissions.py:150
Methodtest_get_emissions_PRIVATE_INFRA_FRA
European country is a specific case as we have there carbon intensity to without computation.
tests/test_emissions.py:57
Methodtest_get_emissions_PRIVATE_INFRA_NOR
Norway utilises hydropower more than any other country around the globe
tests/test_emissions.py:91
Methodtest_get_emissions_PRIVATE_INFRA_NORDIC_FINLAND
(self)
tests/test_emissions.py:227
Methodtest_get_emissions_PRIVATE_INFRA_NORDIC_REGION
(self)
tests/test_emissions.py:212
Methodtest_get_emissions_PRIVATE_INFRA_NORDIC_REGION_uses_static_factor_without_token
( self, )
tests/test_emissions.py:242
Methodtest_get_emissions_PRIVATE_INFRA_UNKNOWN
Test with a country that is not in the list of known countries.
tests/test_emissions.py:72
Methodtest_get_emissions_PRIVATE_INFRA_USA_WITHOUT_COUNTRYNAME
(self)
tests/test_emissions.py:129
Methodtest_get_emissions_PRIVATE_INFRA_USA_WITHOUT_REGION
(self)
tests/test_emissions.py:118
Methodtest_get_emissions_PRIVATE_INFRA_USA_WITH_REGION
(self)
tests/test_emissions.py:105
Methodtest_get_emissions_PRIVATE_INFRA_unknown_country
If we do not know the country we fallback to a default value.
tests/test_emissions.py:166
Methodtest_get_emissions_PRIVATE_INFRA_without_country_metadata
(self)
tests/test_emissions.py:177
Methodtest_get_emissions_RUNS
(self)
tests/test_electricitymaps_api.py:23
Functiontest_get_emissions_by_id_returns_correct_emission
(client, custom_test_server)
carbonserver/tests/api/routers/test_emissions.py:172
Functiontest_get_emissions_from_run_retreives_all_emissions_from_run
( client, custom_test_server )
carbonserver/tests/api/routers/test_emissions.py:187
Functiontest_get_emissions_unit
( data: pd.DataFrame, expected_unit: units.EmissionUnit )
tests/test_viz_units.py:16
Methodtest_get_emissions_with_api_key
Test with real API call using provided API key
tests/test_electricitymaps_api.py:40
Functiontest_get_env_cloud_details_mapping_aws
()
tests/test_cloud.py:38
Functiontest_get_env_cloud_details_mapping_azure
()
tests/test_cloud.py:46
Functiontest_get_env_cloud_details_mapping_google
()
tests/test_cloud.py:54
Functiontest_get_env_cloud_details_mapping_google_empty_payload
()
tests/test_cloud.py:69
Functiontest_get_env_cloud_details_mapping_nothing
()
tests/test_cloud.py:77
Functiontest_get_existing_exp_id_reads_experiment_id
(monkeypatch)
tests/cli/test_cli_utils.py:49
Functiontest_get_existing_exp_id_returns_none_on_key_error
(monkeypatch)
tests/cli/test_cli_utils.py:40
Functiontest_get_experiment_by_id_returns_correct_experiment
(client, custom_test_server)
carbonserver/tests/api/routers/test_experiments.py:136
Functiontest_get_experiment_of_project_retrieves_all_experiments_of_project
( client, custom_test_server )
carbonserver/tests/api/routers/test_experiments.py:151
Methodtest_get_experiment_returns_none_on_error
(self)
tests/test_api_call.py:308
Functiontest_get_global_emissions_choropleth_data
( global_energy_mix_data: Dict[str, Dict[str, Any]], )
tests/test_viz_data.py:33
Methodtest_get_global_energy_mix_returns_cached_data
Verify get_global_energy_mix_data() returns cached object.
tests/test_input.py:30
Methodtest_get_gpu_ids
Check parsing of gpu_ids in various forms.
tests/test_gpu_nvidia.py:342
Methodtest_get_gpu_metrics_info_calls_amdsmi
(self)
tests/test_gpu_amd.py:192
Methodtest_get_gpu_name_success_and_failure
(self)
tests/test_gpu_amd.py:259
Methodtest_get_gpu_utilization_and_compute_mode
(self)
tests/test_gpu_amd.py:358
Methodtest_get_headers_prefers_api_key_over_access_token
(self)
tests/test_api_call.py:29
Methodtest_get_id_token
(self, mock_load)
tests/cli/test_cli_auth.py:225
Functiontest_get_install_instructions
( is_mac, is_windows, is_linux, cpu_model, expected_fragment )
tests/test_resource_tracker.py:37
Methodtest_get_matching_cpu
(self)
tests/test_cpu.py:386
Functiontest_get_organization_by_id_returns_correct_org
(client, custom_test_server)
carbonserver/tests/api/routers/test_organizations.py:94
Methodtest_get_power_limit_success_and_exception
(self)
tests/test_gpu_amd.py:341
Methodtest_get_power_usage_fallback_paths
(self)
tests/test_gpu_amd.py:318
Functiontest_get_private_project_no_auth
(client_with_auth, custom_test_server_with_auth)
carbonserver/tests/api/routers/test_projects.py:211
Functiontest_get_project_by_id_returns_correct_project
(client, custom_test_server)
carbonserver/tests/api/routers/test_projects.py:180
Functiontest_get_project_data
(emissions_data: pd.DataFrame)
tests/test_viz_data.py:23
Functiontest_get_projects_from_organization_returns_correct_project
( client, custom_test_server )
carbonserver/tests/api/routers/test_project_tokens.py:98
Functiontest_get_projects_from_organization_returns_correct_project
( client, custom_test_server )
carbonserver/tests/api/routers/test_projects.py:193
Functiontest_get_public_project_no_auth
(client_with_auth, custom_test_server_with_auth)
carbonserver/tests/api/routers/test_projects.py:223
Functiontest_get_run_by_id_returns_correct_run
(client, custom_test_server)
carbonserver/tests/api/routers/test_runs.py:156
Functiontest_get_runs_from_experiment_returns_correct_run
(client, custom_test_server)
carbonserver/tests/api/routers/test_runs.py:187
Methodtest_get_temperature_fallback_and_exception
(self)
tests/test_gpu_amd.py:287
Functiontest_get_token_command_prints_token
(monkeypatch)
tests/cli/test_cli_main.py:211
Methodtest_get_total_energy_consumption_exception_warns
(self)
tests/test_gpu_amd.py:242
← previousnext →1,401–1,500 of 1,889, ranked by callers