project_name string | class_name string | class_modifiers string | class_implements int64 | class_extends int64 | function_name string | function_body string | cyclomatic_complexity int64 | NLOC int64 | num_parameter int64 | num_token int64 | num_variable int64 | start_line int64 | end_line int64 | function_index int64 | function_params string | function_variable string | function_return_type string | function_body_line_type string | function_num_functions int64 | function_num_lines int64 | outgoing_function_count int64 | outgoing_function_names string | incoming_function_count int64 | incoming_function_names string | lexical_representation string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws-deadline_deadline-cloud | TestSnapshotAPI | public | 0 | 0 | test_diff_with_includes_excludes | def test_diff_with_includes_excludes(self,temp_dir,test_case,initial_include,initial_exclude,diff_include,diff_exclude,modified_files,new_files,expected_diff_files,):"""Parametrized test for different filter scenarios with diff:1. Create initial snapshot with specified include/exclude filters2. Modify specified files a... | 3 | 47 | 10 | 279 | 0 | 438 | 506 | 438 | self,temp_dir,test_case,initial_include,initial_exclude,diff_include,diff_exclude,modified_files,new_files,expected_diff_files | [] | None | {"Assign": 7, "Expr": 8, "For": 2, "With": 2} | 24 | 69 | 24 | ["os.path.join", "os.makedirs", "os.path.join", "os.path.join", "os.makedirs", "os.makedirs", "touch", "Path", "os.path.join", "touch", "Path", "os.path.join", "_manifest_snapshot", "self.get_manifest_files", "len", "open", "os.path.join", "f.write", "open", "os.path.join", "f.write", "_manifest_snapshot", "self.get_ma... | 0 | [] | The function (test_diff_with_includes_excludes) defined within the public class called TestSnapshotAPI.The function start at line 438 and ends at 506. It contains 47 lines of code and it has a cyclomatic complexity of 3. It takes 10 parameters, represented as [438.0] and does not return any value. It declares 24.0 func... |
aws-deadline_deadline-cloud | TestReadManifests | public | 0 | 0 | test_valid_manifests | def test_valid_manifests(self, temp_dir, test_manifest_one):"""Test valid manifest file for readArgs:temp_dir: a temporary directorytest_manifest_one: test manifest"""# Givenmanifest_file_name = "manifest_1"file_path = os.path.join(temp_dir, manifest_file_name)with open(file_path, "w", encoding="utf8") as f:json.dump(t... | 1 | 11 | 3 | 103 | 0 | 15 | 39 | 15 | self,temp_dir,test_manifest_one | [] | None | {"AnnAssign": 1, "Assign": 3, "Expr": 2, "With": 1} | 9 | 25 | 9 | ["os.path.join", "open", "json.dump", "_read_manifests", "len", "result.get", "result.get", "isinstance", "len"] | 0 | [] | The function (test_valid_manifests) defined within the public class called TestReadManifests.The function start at line 15 and ends at 39. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [15.0] and does not return any value. It declares 9.0 functions, and It ... |
aws-deadline_deadline-cloud | TestReadManifests | public | 0 | 0 | test_invalid_file_path | def test_invalid_file_path(self):"""Test with non-existent file"""with patch("os.path.isfile", return_value=False):with pytest.raises(NonValidInputError) as exc_info:_read_manifests(["/path/to/nonexistent.json"])assert "not valid" in str(exc_info.value) | 1 | 5 | 1 | 41 | 0 | 41 | 50 | 41 | self | [] | None | {"Expr": 2, "With": 2} | 4 | 10 | 4 | ["patch", "pytest.raises", "_read_manifests", "str"] | 0 | [] | The function (test_invalid_file_path) defined within the public class called TestReadManifests.The function start at line 41 and ends at 50. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It ha... |
aws-deadline_deadline-cloud | TestReadManifests | public | 0 | 0 | test_empty_manifest_list | def test_empty_manifest_list(self):"""Test with empty input"""# Whenresult = _read_manifests([])# Thenassert isinstance(result, dict)assert len(result) == 0 | 1 | 4 | 1 | 27 | 0 | 52 | 62 | 52 | self | [] | None | {"Assign": 1, "Expr": 1} | 3 | 11 | 3 | ["_read_manifests", "isinstance", "len"] | 0 | [] | The function (test_empty_manifest_list) defined within the public class called TestReadManifests.The function start at line 52 and ends at 62. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | manifest_params | def manifest_params(default_manifest_str_v2023_03_03: str) -> list[ManifestParam]:return [ManifestParam(default_manifest_str_v2023_03_03, versions.ManifestVersion.v2023_03_03),] | 1 | 4 | 1 | 26 | 0 | 32 | 35 | 32 | default_manifest_str_v2023_03_03 | [] | list[ManifestParam] | {"Return": 1} | 1 | 4 | 1 | ["ManifestParam"] | 0 | [] | The function (manifest_params) defined within the public class called public.The function start at line 32 and ends at 35. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function calle... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_validate_manifest | def test_validate_manifest(manifest_params: list[ManifestParam]):"""Test the a valid manifest is correctly validated."""for manifest_param in manifest_params:manifest: dict[str, Any] = json.loads(manifest_param.manifest_str)assert decode.validate_manifest(manifest, manifest_param.manifest_version) == (True, None) | 2 | 4 | 1 | 50 | 0 | 38 | 44 | 38 | manifest_params | [] | None | {"AnnAssign": 1, "Expr": 1, "For": 1} | 2 | 7 | 2 | ["json.loads", "decode.validate_manifest"] | 0 | [] | The function (test_validate_manifest) defined within the public class called public.The function start at line 38 and ends at 44. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 funct... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_validate_manifest_manifest_not_valid_manifest | def test_validate_manifest_manifest_not_valid_manifest(manifest_params: list[ManifestParam]):"""Test that a manifest is returned as not valid with an expected error string if the manifest isn't valid"""for manifest_param in manifest_params:manifest: dict[str, Any] = json.loads(manifest_param.manifest_str)del manifest["... | 2 | 8 | 1 | 67 | 0 | 47 | 57 | 47 | manifest_params | [] | None | {"AnnAssign": 1, "Assign": 1, "Expr": 1, "For": 1} | 3 | 11 | 3 | ["json.loads", "decode.validate_manifest", "error_str.startswith"] | 0 | [] | The function (test_validate_manifest_manifest_not_valid_manifest) defined within the public class called public.The function start at line 47 and ends at 57. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode_manifest_v2023_03_03 | def test_decode_manifest_v2023_03_03(default_manifest_str_v2023_03_03: str):"""Test that a v2023-03-03 manifest string decodes to an AssetManifest object as expected."""expected_manifest = AssetManifest_v2023_03_03(hash_alg=HashAlgorithm.XXH128,total_size=10,paths=[Path_v2023_03_03(path="\r", hash="CarriageReturn", siz... | 1 | 26 | 1 | 265 | 1 | 60 | 88 | 60 | default_manifest_str_v2023_03_03 | ['expected_manifest'] | None | {"Assign": 1, "Expr": 1} | 14 | 29 | 14 | ["AssetManifest_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "Path_v2023_03_03", "decode.decode_manifest"] | 0 | [] | The function (test_decode_manifest_v2023_03_03) defined within the public class called public.The function start at line 60 and ends at 88. It contains 26 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 14.0 functions, and It h... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode_manifest_version_not_supported | def test_decode_manifest_version_not_supported():"""Test that a ManifestDecodeValidationError is raised if the manifest passed has a version that isn't valid."""with pytest.raises(ManifestDecodeValidationError,match=re.escape("Unknown manifest version: 1900-06-06 (Currently supported Manifest versions: 2023-03-03)"),):... | 1 | 8 | 0 | 29 | 0 | 91 | 101 | 91 | [] | None | {"Expr": 2, "With": 1} | 3 | 11 | 3 | ["pytest.raises", "re.escape", "decode.decode_manifest"] | 0 | [] | The function (test_decode_manifest_version_not_supported) defined within the public class called public.The function start at line 91 and ends at 101. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode_manifest_version_not_supported_when_multiple_versions_are_supported | def test_decode_manifest_version_not_supported_when_multiple_versions_are_supported():"""Test that a ManifestDecodeValidationError is raised with a descriptive error message if the manifest passedhas a version that isn't valid. In this test, the ManifestVersion class is mocked to simulate having multplesupported manife... | 1 | 18 | 0 | 62 | 4 | 104 | 128 | 104 | ['v2024_04_03', 'UNDEFINED', 'v2023_03_03', 'v2025_05_03'] | None | {"Assign": 4, "Expr": 2, "With": 2} | 4 | 25 | 4 | ["patch", "pytest.raises", "re.escape", "decode.decode_manifest"] | 0 | [] | The function (test_decode_manifest_version_not_supported_when_multiple_versions_are_supported) defined within the public class called public.The function start at line 104 and ends at 128. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode_manifest_not_valid_manifest | def test_decode_manifest_not_valid_manifest():"""Test that a ManifestDecodeValidationError is raised if the manifest passed in is not valid."""with pytest.raises(ManifestDecodeValidationError, match=r"manifest is missing required field\(s\).*"):decode.decode_manifest('{"manifestVersion": "2023-03-03"}') | 1 | 5 | 0 | 24 | 0 | 131 | 138 | 131 | [] | None | {"Expr": 2, "With": 1} | 2 | 8 | 2 | ["pytest.raises", "decode.decode_manifest"] | 0 | [] | The function (test_decode_manifest_not_valid_manifest) defined within the public class called public.The function start at line 131 and ends at 138. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, an... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode_manifest_missing_manifest_version | def test_decode_manifest_missing_manifest_version():"""Test that a ManifestDecodeValidationError is raised if the manifest passed in is missing the manifestVersion field."""with pytest.raises(ManifestDecodeValidationError,match='Manifest is missing the required "manifestVersion" field',):decode.decode_manifest('{"hashA... | 1 | 6 | 0 | 24 | 0 | 141 | 149 | 141 | [] | None | {"Expr": 2, "With": 1} | 2 | 9 | 2 | ["pytest.raises", "decode.decode_manifest"] | 0 | [] | The function (test_decode_manifest_missing_manifest_version) defined within the public class called public.The function start at line 141 and ends at 149. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functio... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode_manifest_hash_not_alphanumeric | def test_decode_manifest_hash_not_alphanumeric():"""Test that a ManifestDecodeValidationError is raised if the manifest contains non-alphanumeric hashes"""invalid_hashes: list[tuple[str, str]] = [("no_dots", "O.o"),("no_foward_slash", "a/b"),("no_back_slash", "a\\\\b"),("no_tildas", "o~o"),]for path, hash in invalid_ha... | 2 | 20 | 0 | 82 | 1 | 152 | 175 | 152 | ['manifest_str'] | None | {"AnnAssign": 1, "Assign": 1, "Expr": 2, "For": 1, "With": 1} | 2 | 24 | 2 | ["pytest.raises", "decode.decode_manifest"] | 0 | [] | The function (test_decode_manifest_hash_not_alphanumeric) defined within the public class called public.The function start at line 152 and ends at 175. It contains 20 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_manifest_model | def test_get_manifest_model(version: ManifestVersion, expected_model: BaseManifestModel):"""Test to ensure that the appropriate manifest model is returned given a manifest version"""model = ManifestModelRegistry.get_manifest_model(version=version)assert model == expected_model# type: ignore[comparison-overlap] | 1 | 3 | 2 | 26 | 1 | 21 | 26 | 21 | version,expected_model | ['model'] | None | {"Assign": 1, "Expr": 1} | 2 | 6 | 2 | ["ManifestModelRegistry.get_manifest_model", "pytest.mark.parametrize"] | 0 | [] | The function (test_get_manifest_model) defined within the public class called public.The function start at line 21 and ends at 26. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [21.0] and does not return any value. It declares 2.0 functions, and It has 2.0 f... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_manifest_model_no_manifest_for_version | def test_get_manifest_model_no_manifest_for_version():"""Test to ensure the correct error gets raised when there is no asset manifest model for a given version."""with pytest.raises(RuntimeError, match=r"No model for asset manifest version: (ManifestVersion.)?UNDEFINED"):ManifestModelRegistry.get_manifest_model(version... | 1 | 5 | 0 | 28 | 0 | 29 | 36 | 29 | [] | None | {"Expr": 2, "With": 1} | 2 | 8 | 2 | ["pytest.raises", "ManifestModelRegistry.get_manifest_model"] | 0 | [] | The function (test_get_manifest_model_no_manifest_for_version) defined within the public class called public.The function start at line 29 and ends at 36. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functio... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_encode | def test_encode():"""Ensure the expected JSON string is returned from the encode function."""manifest = AssetManifest(hash_alg=HashAlgorithm("xxh128"),total_size=10,paths=[ManifestPath(path="test_file", hash="a", size=1, mtime=167907934333848),ManifestPath(path="test_dir/test_file", hash="b", size=1, mtime=147907934483... | 1 | 42 | 0 | 254 | 3 | 14 | 60 | 14 | ['manifest', 'expected', 'a'] | None | {"Assign": 3, "Expr": 1} | 13 | 47 | 13 | ["AssetManifest", "HashAlgorithm", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "manifest.encode"] | 0 | [] | The function (test_encode) defined within the public class called public.The function start at line 14 and ends at 60. It contains 42 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 13.0 functions, and It has 13.0 functions cal... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_decode | def test_decode(default_manifest_str_v2023_03_03: str):"""Ensure the expected AssetManifest is returned from the decode function."""expected = AssetManifest(hash_alg=HashAlgorithm("xxh128"),total_size=10,paths=[ManifestPath(path="\r", hash="CarriageReturn", size=1, mtime=1679079744833848),ManifestPath(path="1", hash="O... | 1 | 26 | 1 | 275 | 1 | 63 | 91 | 63 | default_manifest_str_v2023_03_03 | ['expected'] | None | {"Assign": 1, "Expr": 1} | 16 | 29 | 16 | ["AssetManifest", "HashAlgorithm", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "ManifestPath", "AssetManifest.decode", "json.loads"] | 0 | [] | The function (test_decode) defined within the public class called public.The function start at line 63 and ends at 91. It contains 26 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 16.0 functions, and It has 16.0 functions cal... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_deadline_client | def test_get_deadline_client(boto_config):"""Test that get_deadline_client returns the correct deadline client"""session_mock = Mock()with patch(f"{deadline.__package__}.job_attachments._aws.aws_clients.get_boto3_session") as get_session:get_session.return_value = session_mocksession_mock.client.return_value = Mock()ge... | 1 | 9 | 1 | 49 | 1 | 18 | 30 | 18 | boto_config | ['session_mock'] | None | {"Assign": 3, "Expr": 3, "With": 1} | 5 | 13 | 5 | ["Mock", "patch", "Mock", "get_deadline_client", "session_mock.client.assert_called_with"] | 0 | [] | The function (test_get_deadline_client) defined within the public class called public.The function start at line 18 and ends at 30. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 fun... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_deadline_client_non_default_endpoint | def test_get_deadline_client_non_default_endpoint(boto_config):"""Test that get_deadline_client returns the correct deadline clientand that the endpoint url is the given one when provided."""test_endpoint = "https://test.com"session_mock = Mock()with patch(f"{deadline.__package__}.job_attachments._aws.aws_clients.get_b... | 1 | 10 | 1 | 55 | 2 | 33 | 47 | 33 | boto_config | ['session_mock', 'test_endpoint'] | None | {"Assign": 4, "Expr": 3, "With": 1} | 5 | 15 | 5 | ["Mock", "patch", "Mock", "get_deadline_client", "session_mock.client.assert_called_with"] | 0 | [] | The function (test_get_deadline_client_non_default_endpoint) defined within the public class called public.The function start at line 33 and ends at 47. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 function... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_s3_client | def test_get_s3_client(boto_config):"""Test that get_s3_client returns a properly configured S3 client."""s3_client = get_s3_client()assert s3_client.meta.endpoint_url == "https://s3.us-west-2.amazonaws.com"assert s3_client.meta.config.signature_version == "s3v4"assert s3_client.meta.config.connect_timeout == S3_CONNEC... | 1 | 6 | 1 | 49 | 1 | 50 | 59 | 50 | boto_config | ['s3_client'] | None | {"Assign": 1, "Expr": 1} | 1 | 10 | 1 | ["get_s3_client"] | 0 | [] | The function (test_get_s3_client) defined within the public class called public.The function start at line 50 and ends at 59. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function ca... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_sts_client | def test_get_sts_client(boto_config):sts_client = get_sts_client()assert sts_client.meta.endpoint_url == "https://sts.us-west-2.amazonaws.com" | 1 | 3 | 1 | 18 | 1 | 62 | 65 | 62 | boto_config | ['sts_client'] | None | {"Assign": 1} | 1 | 4 | 1 | ["get_sts_client"] | 0 | [] | The function (test_get_sts_client) defined within the public class called public.The function start at line 62 and ends at 65. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function c... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_queue | def test_get_queue(mock_get_boto3_session, default_queue: Queue, create_get_queue_response):# Set up the mock session and mock deadline clientmock_session = MagicMock()mock_get_boto3_session.return_value = mock_sessionmock_deadline_client = MagicMock()mock_session.client.return_value = mock_deadline_client# Simulate a ... | 1 | 13 | 3 | 94 | 3 | 16 | 32 | 16 | mock_get_boto3_session,default_queue,create_get_queue_response | ['result', 'mock_deadline_client', 'mock_session'] | None | {"Assign": 6, "Expr": 3} | 8 | 17 | 8 | ["MagicMock", "MagicMock", "create_get_queue_response", "get_queue", "mock_get_boto3_session.assert_called_once", "mock_session.client.assert_called_with", "mock_deadline_client.get_queue.assert_called_once_with", "patch"] | 0 | [] | The function (test_get_queue) defined within the public class called public.The function start at line 16 and ends at 32. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [16.0] and does not return any value. It declares 8.0 functions, and It has 8.0 functions... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_queue_client_error | def test_get_queue_client_error(mock_get_deadline_client, default_queue: Queue):# Set up the mock deadline clientmock_client = mock_get_deadline_client.return_value# Simulate a ClientError from get_queuemock_client.get_queue.side_effect = ClientError({"Error": {"Code": "SomeErrorCode", "Message": "SomeErrorMessage"}},"... | 1 | 11 | 2 | 68 | 1 | 36 | 51 | 36 | mock_get_deadline_client,default_queue | ['mock_client'] | None | {"Assign": 2, "Expr": 1, "With": 1} | 5 | 16 | 5 | ["ClientError", "pytest.raises", "get_queue", "str", "patch"] | 0 | [] | The function (test_get_queue_client_error) defined within the public class called public.The function start at line 36 and ends at 51. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [36.0] and does not return any value. It declares 5.0 functions, and It has ... |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_get_default_cache_db_file_dir_env_var_path_exists | def test_get_default_cache_db_file_dir_env_var_path_exists(self, tmpdir):"""Tests that when an environment variable exists, it uses that path for the hash cache"""expected_path = tmpdir.join(".deadline").join("job_attachments")with patch("os.environ.get", side_effect=[tmpdir]):assert CacheDB.get_default_cache_db_file_d... | 1 | 4 | 2 | 41 | 0 | 28 | 34 | 28 | self,tmpdir | [] | None | {"Assign": 1, "Expr": 1, "With": 1} | 4 | 7 | 4 | ["join", "tmpdir.join", "patch", "CacheDB.get_default_cache_db_file_dir"] | 0 | [] | The function (test_get_default_cache_db_file_dir_env_var_path_exists) defined within the public class called TestCacheDB.The function start at line 28 and ends at 34. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [28.0] and does not return any value. It decla... |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_init_empty_path_no_default_throws_error | def test_init_empty_path_no_default_throws_error(self):"""Tests that when no cache file path is given, the default is used."""os.environ.pop("APPDATA", None)os.environ.pop("HOME", None)os.environ.pop("XDG_CONFIG_HOME", None)with pytest.raises(JobAttachmentsError):CacheDB("name", "table", "query") | 1 | 6 | 1 | 52 | 0 | 36 | 45 | 36 | self | [] | None | {"Expr": 5, "With": 1} | 5 | 10 | 5 | ["os.environ.pop", "os.environ.pop", "os.environ.pop", "pytest.raises", "CacheDB"] | 0 | [] | The function (test_init_empty_path_no_default_throws_error) defined within the public class called TestCacheDB.The function start at line 36 and ends at 45. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 funct... |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_enter_bad_cache_path_throws_error | def test_enter_bad_cache_path_throws_error(self, tmpdir):"""Tests that an error is raised when a bad path is provided to the CacheDB constructor"""with pytest.raises(JobAttachmentsError) as err:cdb = CacheDB("name", "table", "query", tmpdir)cdb.cache_dir = "/some/bad/path"with cdb:assert False, ("Context manager should... | 1 | 9 | 2 | 55 | 0 | 47 | 58 | 47 | self,tmpdir | [] | None | {"Assign": 2, "Expr": 1, "With": 2} | 3 | 12 | 3 | ["pytest.raises", "CacheDB", "isinstance"] | 0 | [] | The function (test_enter_bad_cache_path_throws_error) defined within the public class called TestCacheDB.The function start at line 47 and ends at 58. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [47.0] and does not return any value. It declares 3.0 function... |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_init_throws_error_on_empty_strings | def test_init_throws_error_on_empty_strings(self, cache_name, table_name, create_query):"""Tests that a JobAttachmentsError is raised if init args are empty"""with pytest.raises(JobAttachmentsError):CacheDB(cache_name, table_name, create_query) | 1 | 3 | 4 | 28 | 0 | 68 | 71 | 68 | self,cache_name,table_name,create_query | [] | None | {"Expr": 2, "With": 1} | 6 | 4 | 6 | ["pytest.raises", "CacheDB", "pytest.mark.parametrize", "pytest.param", "pytest.param", "pytest.param"] | 0 | [] | The function (test_init_throws_error_on_empty_strings) defined within the public class called TestCacheDB.The function start at line 68 and ends at 71. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [68.0] and does not return any value. It declares 6.0 functio... |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_get_local_connection_same_thread | def test_get_local_connection_same_thread(self, tmpdir):"""Tests that get_local_connection returns the same connection for a single thread"""cache_dir = tmpdir.mkdir("cache")with CacheDB("test", "test_table", "CREATE TABLE test_table (id INTEGER)", cache_dir) as cdb:# Get connection from main threadconn1 = cdb.get_loca... | 1 | 8 | 2 | 48 | 0 | 73 | 85 | 73 | self,tmpdir | [] | None | {"Assign": 3, "Expr": 1, "With": 1} | 4 | 13 | 4 | ["tmpdir.mkdir", "CacheDB", "cdb.get_local_connection", "cdb.get_local_connection"] | 0 | [] | The function (test_get_local_connection_same_thread) defined within the public class called TestCacheDB.The function start at line 73 and ends at 85. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [73.0] and does not return any value. It declares 4.0 functions... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_local_connection_different_threads.get_connection | def get_connection(thread_id):connections[thread_id] = cdb.get_local_connection() | 1 | 2 | 1 | 15 | 0 | 97 | 98 | 97 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_get_local_connection_different_threads.get_connection) defined within the public class called public.The function start at line 97 and ends at 98. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_get_local_connection_different_threads | def test_get_local_connection_different_threads(self, tmpdir):"""Tests that get_local_connection creates separate connections for different threads"""cache_dir = tmpdir.mkdir("cache")connections = {}# Create the cache and table firstwith CacheDB("test", "test_table", "CREATE TABLE test_table (id INTEGER)", cache_dir) a... | 1 | 14 | 2 | 101 | 0 | 87 | 110 | 87 | self,tmpdir | [] | None | {"Assign": 5, "Expr": 5, "With": 1} | 9 | 24 | 9 | ["tmpdir.mkdir", "CacheDB", "cdb.get_local_connection", "threading.Thread", "threading.Thread", "thread1.start", "thread2.start", "thread1.join", "thread2.join"] | 0 | [] | The function (test_get_local_connection_different_threads) defined within the public class called TestCacheDB.The function start at line 87 and ends at 110. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [87.0] and does not return any value. It declares 9.0 f... |
aws-deadline_deadline-cloud | TestCacheDB | public | 0 | 0 | test_get_local_connection_handles_sqlite_error | def test_get_local_connection_handles_sqlite_error(self, tmpdir):"""Tests that get_local_connection raises JobAttachmentsError on SQLite errors"""with CacheDB("test", "test_table", "CREATE TABLE test_table (id INTEGER)", tmpdir) as cdb:# Mock sqlite3.connect to raise OperationalErrorwith patch("sqlite3.connect", side_e... | 1 | 6 | 2 | 59 | 0 | 112 | 119 | 112 | self,tmpdir | [] | None | {"Expr": 2, "With": 3} | 6 | 8 | 6 | ["CacheDB", "patch", "OperationalError", "pytest.raises", "cdb.get_local_connection", "str"] | 0 | [] | The function (test_get_local_connection_handles_sqlite_error) defined within the public class called TestCacheDB.The function start at line 112 and ends at 119. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [112.0] and does not return any value. It declares 6... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_init_empty_path | def test_init_empty_path(self, tmpdir):"""Tests that when no cache file path is given, the default is used."""with patch(f"{deadline.__package__}.job_attachments.caches.CacheDB.get_default_cache_db_file_dir",side_effect=[tmpdir],):hc = HashCache()assert hc.cache_dir == tmpdir.join(f"{HashCache.CACHE_NAME}.db") | 1 | 7 | 2 | 39 | 0 | 127 | 136 | 127 | self,tmpdir | [] | None | {"Assign": 1, "Expr": 1, "With": 1} | 3 | 10 | 3 | ["patch", "HashCache", "tmpdir.join"] | 0 | [] | The function (test_init_empty_path) defined within the public class called TestHashCache.The function start at line 127 and ends at 136. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [127.0] and does not return any value. It declares 3.0 functions, and It ha... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_get_entry_returns_valid_entry | def test_get_entry_returns_valid_entry(self, tmpdir, file_path):"""Tests that a valid entry is returned when it exists in the cache already"""# GIVENcache_dir = tmpdir.mkdir("cache")expected_entry = HashCacheEntry(file_path=file_path,hash_algorithm=HashAlgorithm.XXH128,file_hash="hash",last_modified_time="1234.5678",)#... | 1 | 12 | 3 | 71 | 0 | 149 | 168 | 149 | self,tmpdir,file_path | [] | None | {"Assign": 3, "Expr": 2, "With": 1} | 9 | 20 | 9 | ["tmpdir.mkdir", "HashCacheEntry", "HashCache", "hc.put_entry", "hc.get_entry", "pytest.mark.parametrize", "pytest.param", "pytest.param", "pytest.param"] | 0 | [] | The function (test_get_entry_returns_valid_entry) defined within the public class called TestHashCache.The function start at line 149 and ends at 168. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [149.0] and does not return any value. It declares 9.0 functi... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_enter_sqlite_import_error | def test_enter_sqlite_import_error(self, tmpdir):"""Tests that the cache doesn't throw errors when the SQLite module can't be found"""with patch.dict("sys.modules", {"sqlite3": None}):new_dir = tmpdir.join("does_not_exist")hc = HashCache(new_dir)assert not os.path.exists(new_dir)with hc:assert hc.get_entry("/no/file", ... | 1 | 16 | 2 | 101 | 0 | 170 | 188 | 170 | self,tmpdir | [] | None | {"Assign": 2, "Expr": 2, "With": 2} | 8 | 19 | 8 | ["patch.dict", "tmpdir.join", "HashCache", "os.path.exists", "hc.get_entry", "hc.put_entry", "HashCacheEntry", "hc.get_entry"] | 0 | [] | The function (test_enter_sqlite_import_error) defined within the public class called TestHashCache.The function start at line 170 and ends at 188. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [170.0] and does not return any value. It declares 8.0 functions,... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_table_creation_idempotent | def test_table_creation_idempotent(self, tmpdir):"""Tests that creating the hash cache table multiple times doesn't cause errors"""cache_dir = tmpdir.mkdir("cache")# Create the cache and table first timewith HashCache(cache_dir) as hc1:test_entry = HashCacheEntry(file_path="/test/file",hash_algorithm=HashAlgorithm.XXH1... | 1 | 24 | 2 | 138 | 0 | 190 | 223 | 190 | self,tmpdir | [] | None | {"Assign": 6, "Expr": 3, "With": 2} | 10 | 34 | 10 | ["tmpdir.mkdir", "HashCache", "HashCacheEntry", "hc1.put_entry", "hc1.get_entry", "HashCache", "hc2.get_entry", "HashCacheEntry", "hc2.put_entry", "hc2.get_entry"] | 0 | [] | The function (test_table_creation_idempotent) defined within the public class called TestHashCache.The function start at line 190 and ends at 223. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [190.0] and does not return any value. It declares 10.0 functions... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_table_already_exists_no_error | def test_table_already_exists_no_error(self, tmpdir):"""Tests that no error is raised when trying to create a table that already existsThis specifically tests the 'IF NOT EXISTS' clause in the CREATE TABLE statement"""import sqlite3cache_dir = tmpdir.mkdir("cache")db_path = os.path.join(cache_dir, "hash_cache.db")# Cre... | 1 | 21 | 2 | 131 | 0 | 225 | 258 | 225 | self,tmpdir | [] | None | {"Assign": 6, "Expr": 5, "With": 2} | 11 | 34 | 11 | ["tmpdir.mkdir", "os.path.join", "HashCache", "sqlite3.connect", "conn.execute", "conn.execute", "conn.commit", "HashCacheEntry", "hc.put_entry", "hc.get_entry", "hc.get_entry"] | 0 | [] | The function (test_table_already_exists_no_error) defined within the public class called TestHashCache.The function start at line 225 and ends at 258. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [225.0] and does not return any value. It declares 11.0 funct... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_init_empty_path | def test_init_empty_path(self, tmpdir):"""Tests that when no cache file path is given, the default is used."""with patch(f"{deadline.__package__}.job_attachments.caches.CacheDB.get_default_cache_db_file_dir",side_effect=[tmpdir],):hc = HashCache()assert hc.cache_dir == tmpdir.join(f"{HashCache.CACHE_NAME}.db") | 1 | 7 | 2 | 39 | 0 | 266 | 275 | 127 | self,tmpdir | [] | None | {"Assign": 1, "Expr": 1, "With": 1} | 3 | 10 | 3 | ["patch", "HashCache", "tmpdir.join"] | 0 | [] | The function (test_init_empty_path) defined within the public class called TestHashCache.The function start at line 266 and ends at 275. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [127.0] and does not return any value. It declares 3.0 functions, and It ha... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_get_entry_returns_valid_entry | def test_get_entry_returns_valid_entry(self, tmpdir):"""Tests that a valid entry is returned when it exists in the cache already"""# GIVENcache_dir = tmpdir.mkdir("cache")expected_entry = S3CheckCacheEntry(s3_key="bucket/Data/somehash",last_seen_time=str(datetime.now().timestamp()),)# WHENwith S3CheckCache(cache_dir) a... | 1 | 10 | 2 | 66 | 0 | 277 | 294 | 277 | self,tmpdir,file_path | [] | None | {"Assign": 3, "Expr": 2, "With": 1} | 9 | 20 | 9 | ["tmpdir.mkdir", "HashCacheEntry", "HashCache", "hc.put_entry", "hc.get_entry", "pytest.mark.parametrize", "pytest.param", "pytest.param", "pytest.param"] | 0 | [] | The function (test_get_entry_returns_valid_entry) defined within the public class called TestHashCache.The function start at line 277 and ends at 294. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [277.0] and does not return any value. It declares 9.0 functi... |
aws-deadline_deadline-cloud | TestS3CheckCache | public | 0 | 0 | test_get_entry_returns_none_with_expired_entry | def test_get_entry_returns_none_with_expired_entry(self, tmpdir):"""Tests that nothing is returned when an existing entry is expired"""# GIVENcache_dir = tmpdir.mkdir("cache")expected_entry = S3CheckCacheEntry(s3_key="bucket/Data/somehash",last_seen_time="123.456",# a looong time ago)# WHENwith S3CheckCache(cache_dir) ... | 1 | 10 | 2 | 55 | 0 | 296 | 313 | 296 | self,tmpdir | [] | None | {"Assign": 3, "Expr": 2, "With": 1} | 5 | 18 | 5 | ["tmpdir.mkdir", "S3CheckCacheEntry", "S3CheckCache", "s3c.put_entry", "s3c.get_entry"] | 0 | [] | The function (test_get_entry_returns_none_with_expired_entry) defined within the public class called TestS3CheckCache.The function start at line 296 and ends at 313. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [296.0] and does not return any value. It decl... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_enter_sqlite_import_error | def test_enter_sqlite_import_error(self, tmpdir):"""Tests that the cache doesn't throw errors when the SQLite module can't be found"""with patch.dict("sys.modules", {"sqlite3": None}):new_dir = tmpdir.join("does_not_exist")s3c = S3CheckCache(new_dir)assert not os.path.exists(new_dir)with s3c:assert s3c.get_entry("bucke... | 1 | 14 | 2 | 94 | 0 | 315 | 331 | 315 | self,tmpdir | [] | None | {"Assign": 2, "Expr": 2, "With": 2} | 8 | 19 | 8 | ["patch.dict", "tmpdir.join", "HashCache", "os.path.exists", "hc.get_entry", "hc.put_entry", "HashCacheEntry", "hc.get_entry"] | 0 | [] | The function (test_enter_sqlite_import_error) defined within the public class called TestHashCache.The function start at line 315 and ends at 331. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [315.0] and does not return any value. It declares 8.0 functions,... |
aws-deadline_deadline-cloud | TestS3CheckCache | public | 0 | 0 | test_delete_cache | def test_delete_cache(self, tmpdir):"""Tests if the cache file can be deleted when calling remove_cache"""cache_dir = tmpdir.mkdir("cache")with S3CheckCache(cache_dir) as s3c:file_name: str = os.path.join(cache_dir, "s3_check_cache.db")assert os.path.exists(file_name)s3c.remove_cache()# Test if the cache file was delet... | 1 | 7 | 2 | 62 | 0 | 333 | 344 | 333 | self,tmpdir | [] | None | {"AnnAssign": 1, "Assign": 1, "Expr": 2, "With": 1} | 6 | 12 | 6 | ["tmpdir.mkdir", "S3CheckCache", "os.path.join", "os.path.exists", "s3c.remove_cache", "os.path.exists"] | 0 | [] | The function (test_delete_cache) defined within the public class called TestS3CheckCache.The function start at line 333 and ends at 344. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [333.0] and does not return any value. It declares 6.0 functions, and It ha... |
aws-deadline_deadline-cloud | TestS3CheckCache | public | 0 | 0 | test_get_connection_entry_returns_valid_entry | def test_get_connection_entry_returns_valid_entry(self, tmpdir):"""Tests that get_connection_entry returns a valid entry with provided connection"""cache_dir = tmpdir.mkdir("cache")expected_entry = S3CheckCacheEntry(s3_key="bucket/Data/somehash",last_seen_time=str(datetime.now().timestamp()),)with S3CheckCache(cache_di... | 1 | 11 | 2 | 75 | 0 | 346 | 359 | 346 | self,tmpdir | [] | None | {"Assign": 4, "Expr": 2, "With": 1} | 9 | 14 | 9 | ["tmpdir.mkdir", "S3CheckCacheEntry", "str", "timestamp", "datetime.now", "S3CheckCache", "s3c.put_entry", "s3c.get_local_connection", "s3c.get_connection_entry"] | 0 | [] | The function (test_get_connection_entry_returns_valid_entry) defined within the public class called TestS3CheckCache.The function start at line 346 and ends at 359. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [346.0] and does not return any value. It decla... |
aws-deadline_deadline-cloud | TestS3CheckCache | public | 0 | 0 | test_get_connection_entry_returns_none_for_nonexistent_key | def test_get_connection_entry_returns_none_for_nonexistent_key(self, tmpdir):"""Tests that get_connection_entry returns None for non-existent key"""cache_dir = tmpdir.mkdir("cache")with S3CheckCache(cache_dir) as s3c:connection = s3c.get_local_connection()actual_entry = s3c.get_connection_entry("nonexistent/key", conne... | 1 | 6 | 2 | 45 | 0 | 361 | 369 | 361 | self,tmpdir | [] | None | {"Assign": 3, "Expr": 1, "With": 1} | 4 | 9 | 4 | ["tmpdir.mkdir", "S3CheckCache", "s3c.get_local_connection", "s3c.get_connection_entry"] | 0 | [] | The function (test_get_connection_entry_returns_none_for_nonexistent_key) defined within the public class called TestS3CheckCache.The function start at line 361 and ends at 369. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [361.0] and does not return any val... |
aws-deadline_deadline-cloud | TestS3CheckCache | public | 0 | 0 | test_get_connection_entry_returns_none_for_expired_entry | def test_get_connection_entry_returns_none_for_expired_entry(self, tmpdir):"""Tests that get_connection_entry returns None for expired entries"""cache_dir = tmpdir.mkdir("cache")expired_entry = S3CheckCacheEntry(s3_key="bucket/Data/somehash",last_seen_time="123.456",# very old timestamp)with S3CheckCache(cache_dir) as ... | 1 | 11 | 2 | 64 | 0 | 371 | 384 | 371 | self,tmpdir | [] | None | {"Assign": 4, "Expr": 2, "With": 1} | 6 | 14 | 6 | ["tmpdir.mkdir", "S3CheckCacheEntry", "S3CheckCache", "s3c.put_entry", "s3c.get_local_connection", "s3c.get_connection_entry"] | 0 | [] | The function (test_get_connection_entry_returns_none_for_expired_entry) defined within the public class called TestS3CheckCache.The function start at line 371 and ends at 384. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [371.0] and does not return any valu... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_table_creation_idempotent | def test_table_creation_idempotent(self, tmpdir):"""Tests that creating the S3 check cache table multiple times doesn't cause errors"""cache_dir = tmpdir.mkdir("cache")# Create the cache and table first timewith S3CheckCache(cache_dir) as s3c1:test_entry = S3CheckCacheEntry(s3_key="bucket/Data/test-hash",last_seen_time... | 1 | 20 | 2 | 128 | 0 | 386 | 415 | 386 | self,tmpdir | [] | None | {"Assign": 6, "Expr": 3, "With": 2} | 10 | 34 | 10 | ["tmpdir.mkdir", "HashCache", "HashCacheEntry", "hc1.put_entry", "hc1.get_entry", "HashCache", "hc2.get_entry", "HashCacheEntry", "hc2.put_entry", "hc2.get_entry"] | 0 | [] | The function (test_table_creation_idempotent) defined within the public class called TestHashCache.The function start at line 386 and ends at 415. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [386.0] and does not return any value. It declares 10.0 functions... |
aws-deadline_deadline-cloud | TestHashCache | public | 0 | 0 | test_table_already_exists_no_error | def test_table_already_exists_no_error(self, tmpdir):"""Tests that no error is raised when trying to create a table that already existsThis specifically tests the 'IF NOT EXISTS' clause in the CREATE TABLE statement"""import sqlite3cache_dir = tmpdir.mkdir("cache")db_path = os.path.join(cache_dir, "s3_check_cache.db")#... | 1 | 17 | 2 | 112 | 0 | 417 | 446 | 417 | self,tmpdir | [] | None | {"Assign": 6, "Expr": 5, "With": 2} | 11 | 34 | 11 | ["tmpdir.mkdir", "os.path.join", "HashCache", "sqlite3.connect", "conn.execute", "conn.execute", "conn.commit", "HashCacheEntry", "hc.put_entry", "hc.get_entry", "hc.get_entry"] | 0 | [] | The function (test_table_already_exists_no_error) defined within the public class called TestHashCache.The function start at line 417 and ends at 446. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [417.0] and does not return any value. It declares 11.0 funct... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | generate_test_job | def generate_test_job(job_id: str, root_paths: list[str]) -> dict[str, Any]:"""Generate a test job with specified root paths for attachment manifests."""return {"jobId": job_id,"name": f"test-job-{job_id}","attachments": {"manifests": [{"rootPath": root_path,"rootPathFormat": "POSIX","inputManifestPath": f"input_manife... | 2 | 17 | 2 | 79 | 0 | 30 | 47 | 30 | job_id,root_paths | [] | dict[str, Any] | {"Expr": 1, "Return": 1} | 1 | 18 | 1 | ["enumerate"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_already_stored", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.C... | The function (generate_test_job) defined within the public class called public.The function start at line 30 and ends at 47. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [30.0] and does not return any value. It declare 1.0 function, It has 1.0 function call... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | generate_session_actions | def generate_session_actions(session_action_ids: list[str],farm_id: str = "farm-01234567890123456789012345678901",queue_id: str = "queue-01234567890123456789012345678901",job_id: str = "job-01234567890123456789012345678901",root_path_hashes: list[str] | None = None,*,with_manifests: bool = False,) -> list[dict[str, Any... | 5 | 28 | 6 | 152 | 7 | 50 | 84 | 50 | session_action_ids,farm_id,queue_id,job_id,root_path_hashes,with_manifests | ['root_path_hashes', 'timestamp', 'session_actions', 'manifest_path', 'task_id', 'step_id', 'manifests'] | list[dict[str, Any]] | {"AnnAssign": 1, "Assign": 8, "Expr": 3, "For": 2, "If": 2, "Return": 1} | 3 | 35 | 3 | ["enumerate", "manifests.append", "session_actions.append"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_already_stored", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.C... | The function (generate_session_actions) defined within the public class called public.The function start at line 50 and ends at 84. It contains 28 lines of code and it has a cyclomatic complexity of 5. It takes 6 parameters, represented as [50.0] and does not return any value. It declares 3.0 functions, It has 3.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | calculate_root_path_hashes | def calculate_root_path_hashes(root_paths: list[str]) -> list[str]:"""Calculate hashes for root paths using the same algorithm as the function under test."""return [ja_hash_data(root_path.encode(), DEFAULT_HASH_ALG) for root_path in root_paths] | 2 | 2 | 1 | 33 | 0 | 87 | 89 | 87 | root_paths | [] | list[str] | {"Expr": 1, "Return": 1} | 2 | 3 | 2 | ["ja_hash_data", "root_path.encode"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_already_stored", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.C... | The function (calculate_root_path_hashes) defined within the public class called public.The function start at line 87 and ends at 89. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functi... |
aws-deadline_deadline-cloud | ManifestKeyBuilder | public | 0 | 0 | __init__ | def __init__(self, root_prefix: str, farm_id: str, queue_id: str, job_id: str):self.root_prefix = root_prefixself.farm_id = farm_idself.queue_id = queue_idself.job_id = job_id | 1 | 5 | 5 | 41 | 0 | 95 | 99 | 95 | self,root_prefix,farm_id,queue_id,job_id | [] | None | {"Assign": 4} | 0 | 5 | 0 | [] | 4,993 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.logging_py.LoggerHandler.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16379211_lorcalhost_btb_manager_telegram.btb_manager_telegram.schedule_... | The function (__init__) defined within the public class called ManifestKeyBuilder.The function start at line 95 and ends at 99. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [95.0] and does not return any value. It has 4993.0 functions calling this function w... |
aws-deadline_deadline-cloud | ManifestKeyBuilder | public | 0 | 0 | build_key | def build_key(self, session_action_id: str, root_path_hash: str) -> str:"""Build a manifest S3 key for testing.Pattern: <root_prefix>/Manifests/<farm_id>/<queue_id>/<job_id>/<step_id>/<task_id>/<timestamp>_<session_action_id>/<manifest_hash>_output"""step_id = "step-123"task_id = "task-456"timestamp = "2023-01-01T12:00... | 1 | 9 | 3 | 34 | 0 | 101 | 113 | 101 | self,session_action_id,root_path_hash | [] | str | {"Assign": 3, "Expr": 1, "Return": 1} | 0 | 13 | 0 | [] | 0 | [] | The function (build_key) defined within the public class called ManifestKeyBuilder.The function start at line 101 and ends at 113. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [101.0] and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | create_manifest_s3_objects | def create_manifest_s3_objects(s3_client, bucket_name: str, manifest_keys: list[str]):"""Create S3 objects for manifest keys with minimal valid content."""manifest_content = json.dumps({"manifestVersion": "2023-03-03", "hashAlg": "xxh128", "paths": [], "totalSize": 0})for key in manifest_keys:s3_client.put_object(Bucke... | 2 | 6 | 3 | 68 | 1 | 116 | 123 | 116 | s3_client,bucket_name,manifest_keys | ['manifest_content'] | None | {"Assign": 1, "Expr": 2, "For": 1} | 3 | 8 | 3 | ["json.dumps", "s3_client.put_object", "manifest_content.encode"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_edge_cases", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Clone... | The function (create_manifest_s3_objects) defined within the public class called public.The function start at line 116 and ends at 123. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [116.0] and does not return any value. It declares 3.0 functions, It has 3.0 ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | validate_manifest_structure | def validate_manifest_structure(manifest_entry: dict[str, Any]) -> None:"""Validate that a manifest entry has the expected structure with proper "outputManifestPath" field format.Requirements: 4.1 - Verify that the populated manifest structure matches the expected format"""assert isinstance(manifest_entry, dict), "Mani... | 1 | 16 | 1 | 88 | 1 | 129 | 151 | 129 | manifest_entry | ['output_path'] | None | {"Assign": 1, "Expr": 1} | 5 | 23 | 5 | ["isinstance", "isinstance", "len", "output_path.startswith", "output_path.startswith"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_edge_cases", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Clone... | The function (validate_manifest_structure) defined within the public class called public.The function start at line 129 and ends at 151. It contains 16 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, It has 5.0 fu... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | validate_root_path_hash_matching | def validate_root_path_hash_matching(job: dict[str, Any], session_actions: list[dict[str, Any]], expected_root_path_hashes: list[str]) -> None:"""Validate that manifests are populated at correct indices based on root path hash matching.Requirements: 4.2 - Verify that each manifest is populated at the correct index in t... | 6 | 23 | 3 | 140 | 5 | 154 | 190 | 154 | job,session_actions,expected_root_path_hashes | ['output_path', 'session_action_id', 'job_manifests', 'expected_hash', 'manifests'] | None | {"Assign": 5, "Expr": 1, "For": 2, "If": 2} | 5 | 37 | 5 | ["get", "job.get", "len", "len", "enumerate"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_edge_cases", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Clone... | The function (validate_root_path_hash_matching) defined within the public class called public.The function start at line 154 and ends at 190. It contains 23 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [154.0] and does not return any value. It declares 5.0 functions, It h... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | validate_existing_session_action_manifests_are_unmodified | def validate_existing_session_action_manifests_are_unmodified(original_session_actions: list[dict[str, Any]], processed_session_actions: list[dict[str, Any]]) -> None:"""Validate that session actions with existing manifests are not modified during processing."""for i, (original, processed) in enumerate(zip(original_ses... | 3 | 11 | 2 | 65 | 0 | 193 | 207 | 193 | original_session_actions,processed_session_actions | [] | None | {"Expr": 1, "For": 1, "If": 1} | 2 | 15 | 2 | ["enumerate", "zip"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_already_stored"] | The function (validate_existing_session_action_manifests_are_unmodified) defined within the public class called public.The function start at line 193 and ends at 207. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [193.0] and does not return any value. It dec... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | validate_manifest_keys_do_not_have_prefix | def validate_manifest_keys_do_not_have_prefix(session_actions: list[dict[str, Any]], root_prefix: str) -> None:"""Validate that output manifest paths do not start with the S3 prefix configured on the queue."""manifest_prefix = f"{root_prefix}/Manifests/"for session_action in session_actions:for manifest in session_acti... | 5 | 15 | 2 | 85 | 2 | 210 | 232 | 210 | session_actions,root_prefix | ['output_path', 'manifest_prefix'] | None | {"Assign": 2, "Expr": 1, "For": 2, "If": 1} | 3 | 23 | 3 | ["session_action.get", "output_path.startswith", "output_path.startswith"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_add_output_manifests_from_s3_py.test_add_output_manifests_from_s3_already_stored", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.C... | The function (validate_manifest_keys_do_not_have_prefix) defined within the public class called public.The function start at line 210 and ends at 232. It contains 15 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [210.0] and does not return any value. It declares 3.0 functi... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_add_output_manifests_from_s3_fill_in_missing_manifests | def test_add_output_manifests_from_s3_fill_in_missing_manifests(fresh_deadline_config):"""Test that _add_output_manifests_from_s3 correctly fills in missing manifest information from S3.This test uses moto to create a mocked S3 bucket structure containing S3 objects with appropriate key namesfor the test, and a mock li... | 8 | 46 | 1 | 276 | 18 | 236 | 318 | 236 | fresh_deadline_config | ['queue', 'root_path_hashes', 'session_actions', 'session_action_ids', 'actual_manifest_count', 'farm_id', 'manifest_key', 's3_client', 'key_builder', 'manifest_keys', 'job_id', 'root_prefix', 'boto3_session', 'bucket_name', 'expected_manifest_count', 'root_paths', 'job', 'queue_id'] | None | {"Assign": 18, "Expr": 8, "For": 4} | 20 | 83 | 20 | ["boto3.client", "s3_client.create_bucket", "generate_test_job", "generate_session_actions", "calculate_root_path_hashes", "ManifestKeyBuilder", "key_builder.build_key", "manifest_keys.append", "create_manifest_s3_objects", "boto3.Session", "_add_output_manifests_from_s3", "len", "len", "validate_manifest_structure", "... | 0 | [] | The function (test_add_output_manifests_from_s3_fill_in_missing_manifests) defined within the public class called public.The function start at line 236 and ends at 318. It contains 46 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It decla... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_add_output_manifests_from_s3_already_stored | def test_add_output_manifests_from_s3_already_stored(fresh_deadline_config):"""Test that _add_output_manifests_from_s3 does not modify session actions with existing manifests.This test confirms that no S3 APIs are accessed, and that the manifests already in the mocklist_session_actions response are not modified when se... | 1 | 40 | 1 | 168 | 13 | 321 | 390 | 321 | fresh_deadline_config | ['queue', 'root_path_hashes', 'session_actions', 'session_action_ids', 'farm_id', 'original_session_actions', 'job_id', 'root_prefix', 'boto3_session', 'bucket_name', 'root_paths', 'job', 'queue_id'] | None | {"Assign": 13, "Expr": 5, "With": 1} | 11 | 70 | 11 | ["generate_test_job", "calculate_root_path_hashes", "generate_session_actions", "json.loads", "json.dumps", "boto3.Session", "patch", "_add_output_manifests_from_s3", "mock_get_keys.assert_not_called", "validate_existing_session_action_manifests_are_unmodified", "validate_manifest_keys_do_not_have_prefix"] | 0 | [] | The function (test_add_output_manifests_from_s3_already_stored) defined within the public class called public.The function start at line 321 and ends at 390. It contains 40 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 11.0 fu... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_add_output_manifests_from_s3_edge_cases | def test_add_output_manifests_from_s3_edge_cases(fresh_deadline_config):"""Test that _add_output_manifests_from_s3 handles edge cases and mixed scenarios correctly.This test validates edge cases including empty session action lists and mixed scenarioswhere some session actions have manifests and others don't, ensuring ... | 10 | 75 | 1 | 376 | 21 | 394 | 515 | 394 | fresh_deadline_config | ['root_path_hashes', 'session_actions_without_manifests', 'original_mixed_session_actions', 'original_sa', 'boto3_session', 'root_paths', 'session_actions_with_manifests', 'farm_id', 'session_action_ids_without', 'manifest_key', 'key_builder', 'job', 'queue', 'session_action_ids_with', 'job_id', 'root_prefix', 'bucket_... | None | {"AnnAssign": 1, "Assign": 21, "Expr": 9, "For": 5, "If": 2} | 20 | 122 | 20 | ["boto3.client", "s3_client.create_bucket", "generate_test_job", "calculate_root_path_hashes", "boto3.Session", "_add_output_manifests_from_s3", "generate_session_actions", "generate_session_actions", "json.loads", "json.dumps", "ManifestKeyBuilder", "key_builder.build_key", "manifest_keys.append", "create_manifest_s3_... | 0 | [] | The function (test_add_output_manifests_from_s3_edge_cases) defined within the public class called public.The function start at line 394 and ends at 515. It contains 75 lines of code and it has a cyclomatic complexity of 10. The function does not take any parameters and does not return any value. It declares 20.0 funct... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | mock_logger | def mock_logger(self):"""Fixture to create a mock logger object."""logger = MagicMock()logger.echo = MagicMock()return logger | 1 | 4 | 1 | 20 | 0 | 19 | 25 | 19 | self | [] | Returns | {"Assign": 2, "Expr": 1, "Return": 1} | 2 | 7 | 2 | ["MagicMock", "MagicMock"] | 0 | [] | The function (mock_logger) defined within the public class called TestIncrementalDownloadState.The function start at line 19 and ends at 25. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and I... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | temp_dir | def temp_dir(self):"""Fixture to provide a temporary directory that is cleaned up after tests."""with tempfile.TemporaryDirectory() as tmpdir:yield tmpdir | 1 | 3 | 1 | 17 | 0 | 28 | 33 | 28 | self | [] | None | {"Expr": 2, "With": 1} | 1 | 6 | 1 | ["tempfile.TemporaryDirectory"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3924769_jaraco_zipp.tests.test_path_py.TestPath.zipfile_ondisk"] | The function (temp_dir) defined within the public class called TestIncrementalDownloadState.The function start at line 28 and ends at 33. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 func... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | test_paths | def test_paths(self, temp_dir):"""Fixture to provide test file paths using a real temporary directory."""return {"location": temp_dir,"progress_file": os.path.join(temp_dir, "download_checkpoint.json"),} | 1 | 5 | 2 | 28 | 0 | 36 | 43 | 36 | self,temp_dir | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 8 | 1 | ["os.path.join"] | 0 | [] | The function (test_paths) defined within the public class called TestIncrementalDownloadState.The function start at line 36 and ends at 43. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [36.0], and this function return a value. It declare 1.0 function, and I... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | sample_state_data | def sample_state_data(self):"""Fixture to provide sample state data."""return {"downloadsStartedTimestamp": "2023-01-01T00:00:00+00:00","downloadsCompletedTimestamp": "2023-01-02T00:00:00+00:00","eventualConsistencyMaxSeconds": EVENTUAL_CONSISTENCY_MAX_SECONDS,"jobs": [{"jobId": "job-123", "name": "Job 1"}, {"jobId": "... | 1 | 7 | 1 | 45 | 0 | 46 | 55 | 46 | self | [] | Returns | {"Expr": 1, "Return": 1} | 0 | 10 | 0 | [] | 0 | [] | The function (sample_state_data) defined within the public class called TestIncrementalDownloadState.The function start at line 46 and ends at 55. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | state_file | def state_file(self, test_paths, sample_state_data):"""Fixture to create a real state file with sample data."""with open(test_paths["progress_file"], "w") as f:json.dump(sample_state_data, f, indent=2)yield test_paths["progress_file"] | 1 | 4 | 3 | 40 | 0 | 58 | 64 | 58 | self,test_paths,sample_state_data | [] | None | {"Expr": 3, "With": 1} | 2 | 7 | 2 | ["open", "json.dump"] | 0 | [] | The function (state_file) defined within the public class called TestIncrementalDownloadState.The function start at line 58 and ends at 64. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [58.0] and does not return any value. It declares 2.0 functions, and It ... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | mock_download_state | def mock_download_state(self):"""Fixture to create a sample IncrementalDownloadState. This state matches the sample_state_data fixture."""return IncrementalDownloadState("sp-123",downloads_started_timestamp=datetime.fromisoformat("2023-01-01T00:00:00+00:00"),downloads_completed_timestamp=datetime.fromisoformat("2023-01... | 1 | 14 | 1 | 77 | 0 | 68 | 84 | 68 | self | [] | Returns | {"Expr": 1, "Return": 1} | 6 | 17 | 6 | ["IncrementalDownloadState", "datetime.fromisoformat", "datetime.fromisoformat", "IncrementalDownloadJob", "IncrementalDownloadJob", "datetime.fromisoformat"] | 0 | [] | The function (mock_download_state) defined within the public class called TestIncrementalDownloadState.The function start at line 68 and ends at 84. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 6.0 function... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | test_incremental_download_state_init | def test_incremental_download_state_init(self):"""Test IncrementalDownloadState initialization."""bootstrap_time = datetime.fromisoformat("2023-01-01T00:00:00")completed_time = datetime.fromisoformat("2023-01-02T00:00:00")# Test with minimal bootstrapped constructionstate = IncrementalDownloadState("sp-123", bootstrap_... | 1 | 18 | 1 | 109 | 0 | 86 | 110 | 86 | self | [] | None | {"Assign": 5, "Expr": 1} | 5 | 25 | 5 | ["datetime.fromisoformat", "datetime.fromisoformat", "IncrementalDownloadState", "IncrementalDownloadJob", "IncrementalDownloadState"] | 0 | [] | The function (test_incremental_download_state_init) defined within the public class called TestIncrementalDownloadState.The function start at line 86 and ends at 110. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | test_incremental_download_state_dict_roundtrip | def test_incremental_download_state_dict_roundtrip(self, mock_download_state):"""Test IncrementalDownloadState.from_dict and to_dict methods, by roundtripping."""dict_state = mock_download_state.to_dict()assert dict_state == IncrementalDownloadState.from_dict(dict_state).to_dict() | 1 | 3 | 2 | 28 | 0 | 112 | 119 | 112 | self,mock_download_state | [] | None | {"Assign": 1, "Expr": 1} | 3 | 8 | 3 | ["mock_download_state.to_dict", "to_dict", "IncrementalDownloadState.from_dict"] | 0 | [] | The function (test_incremental_download_state_dict_roundtrip) defined within the public class called TestIncrementalDownloadState.The function start at line 112 and ends at 119. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [112.0] and does not return any val... |
aws-deadline_deadline-cloud | TestIncrementalDownloadState | public | 0 | 0 | test_incremental_download_state_file_roundtrip | def test_incremental_download_state_file_roundtrip(self, temp_dir, mock_download_state: IncrementalDownloadState):"""Test IncrementalDownloadState.from_file and save_file methods, by roundtripping."""dict_state = mock_download_state.to_dict()file_path = os.path.join(temp_dir, "checkpoint.json")mock_download_state.save_... | 1 | 8 | 3 | 53 | 0 | 121 | 134 | 121 | self,temp_dir,mock_download_state | [] | None | {"Assign": 3, "Expr": 2} | 5 | 14 | 5 | ["mock_download_state.to_dict", "os.path.join", "mock_download_state.save_file", "IncrementalDownloadState.from_file", "roundtrip_state.to_dict"] | 0 | [] | The function (test_incremental_download_state_file_roundtrip) defined within the public class called TestIncrementalDownloadState.The function start at line 121 and ends at 134. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [121.0] and does not return any val... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | generate_random_path | def generate_random_path():"""Generate a random path with a few subdirectories."""part_count = random.randrange(1, 3)return str(PurePosixPath(*[f"part-{i}-{random.randrange(4)}" for i in range(part_count - 1)],f"{uuid.uuid4()}.ext",)) | 2 | 8 | 0 | 40 | 1 | 40 | 48 | 40 | ['part_count'] | Returns | {"Assign": 1, "Expr": 1, "Return": 1} | 6 | 9 | 6 | ["random.randrange", "str", "PurePosixPath", "random.randrange", "range", "uuid.uuid4"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_manifest_download_py.generate_random_files"] | The function (generate_random_path) defined within the public class called public.The function start at line 40 and ends at 48. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 6.0 functions, It has 6.0 function... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | generate_random_files | def generate_random_files(file_count, file_size_min, file_size_max):random_files = {}for i in range(file_count):file_size = random.randrange(file_size_min, file_size_max)file_contents = random.randbytes(file_size)#type: ignorefile_path = generate_random_path()random_files[file_path] = file_contentsreturn random_files | 2 | 8 | 3 | 52 | 4 | 51 | 60 | 51 | file_count,file_size_min,file_size_max | ['file_path', 'file_size', 'file_contents', 'random_files'] | Returns | {"Assign": 5, "For": 1, "Return": 1} | 4 | 10 | 4 | ["range", "random.randrange", "random.randbytes", "generate_random_path"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_manifest_download_py.generate_fake_job_with_output_manifest"] | The function (generate_random_files) defined within the public class called public.The function start at line 51 and ends at 60. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [51.0], and this function return a value. It declares 4.0 functions, It has 4.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | generate_fake_job_with_output_manifest | def generate_fake_job_with_output_manifest(tmp_path: Path,queue: dict,file_count: int,file_size_min: int,file_size_max: int,out_jobs: list,out_job_sessions: dict,out_expected_download_files: dict,):"""Given a fake queue and a moto session for s3, generates a fake job with correspondingsession and session actions. Puts ... | 7 | 97 | 8 | 505 | 13 | 63 | 183 | 63 | tmp_path,queue,file_count,file_size_min,file_size_max,out_jobs,out_job_sessions,out_expected_download_files | ['manifest_count', 's3_key', 'manifest_index', 's3', 'random_files', 'manifest_bytes', 'total_size', 'job_id', 'manifest', 'manifest_hash', 'session_action_manifests', 'job', 'bucket'] | None | {"AnnAssign": 5, "Assign": 17, "AugAssign": 1, "Expr": 7, "For": 3, "If": 1} | 43 | 121 | 43 | ["random.randrange", "boto3.resource", "s3.Bucket", "replace", "str", "uuid.uuid4", "str", "range", "out_jobs.append", "generate_random_files", "range", "random_files.items", "random.randrange", "str", "Path", "enumerate", "files.items", "hash_data", "bucket.put_object", "paths.append", "ManifestPath", "hash_data", "le... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_job_attachments.incremental_downloads.test_manifest_download_py.test_manifest_and_output_downloads"] | The function (generate_fake_job_with_output_manifest) defined within the public class called public.The function start at line 63 and ends at 183. It contains 97 lines of code and it has a cyclomatic complexity of 7. It takes 8 parameters, represented as [63.0] and does not return any value. It declares 43.0 functions,... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_manifest_and_output_downloads.on_downloading_files | def on_downloading_files(download_metadata: ProgressReportMetadata,) -> bool:return True | 1 | 4 | 1 | 12 | 0 | 257 | 260 | 257 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_manifest_and_output_downloads.on_downloading_files) defined within the public class called public.The function start at line 257 and ends at 260. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_manifest_and_output_downloads | def test_manifest_and_output_downloads(tmp_path, fresh_deadline_config):"""This test uses moto3 to mock a bunch of job attachment output data in S3, and thencalls the sequence of functions used in incremental downloads"""queue_id = "queue-01234567890123456789012345678901"bucket_name = "test-bucket"root_prefix = "test-p... | 6 | 60 | 2 | 330 | 6 | 190 | 277 | 190 | tmp_path,fresh_deadline_config | ['queue', 's3_client', 'root_prefix', 'boto3_session', 'bucket_name', 'queue_id'] | Returns | {"AnnAssign": 6, "Assign": 6, "Expr": 6, "For": 3, "Return": 1, "With": 1} | 18 | 88 | 18 | ["boto3.Session", "boto3_session.client", "s3_client.create_bucket", "generate_fake_job_with_output_manifest", "generate_fake_job_with_output_manifest", "generate_fake_job_with_output_manifest", "_download_all_manifests_with_absolute_paths", "os.path.isabs", "_merge_absolute_path_manifest_list", "set", "expected_downlo... | 0 | [] | The function (test_manifest_and_output_downloads) defined within the public class called public.The function start at line 190 and ends at 277. It contains 60 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [190.0], and this function return a value. It declares 18.0 function... |
aws-deadline_deadline-cloud | TestToolRegistry | public | 0 | 0 | test_registry_structure | def test_registry_structure(self):"""Test that TOOL_REGISTRY has valid structure."""assert isinstance(TOOL_REGISTRY, dict)assert len(TOOL_REGISTRY) > 0for definition in TOOL_REGISTRY.values():assert "func" in definitionassert "param_names" in definitionassert callable(definition["func"]) | 2 | 7 | 1 | 45 | 0 | 30 | 38 | 30 | self | [] | None | {"Expr": 1, "For": 1} | 4 | 9 | 4 | ["isinstance", "len", "TOOL_REGISTRY.values", "callable"] | 0 | [] | The function (test_registry_structure) defined within the public class called TestToolRegistry.The function start at line 30 and ends at 38. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It ha... |
aws-deadline_deadline-cloud | TestToolRegistry | public | 0 | 0 | test_expected_functions | def test_expected_functions(self):"""Test that expected functions are in the registry."""expected = ["list_farms", "submit_job", "download_job_output"]for func_name in expected:assert func_name in TOOL_REGISTRY | 2 | 4 | 1 | 24 | 0 | 40 | 44 | 40 | self | [] | None | {"Assign": 1, "Expr": 1, "For": 1} | 0 | 5 | 0 | [] | 0 | [] | The function (test_expected_functions) defined within the public class called TestToolRegistry.The function start at line 40 and ends at 44. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_default_serializer.__init__ | def __init__(self):self.attr = "value" | 1 | 2 | 1 | 10 | 0 | 56 | 57 | 56 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_default_serializer.__init__) defined within the public class called public.The function start at line 56 and ends at 57. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | TestUtilityFunctions | public | 0 | 0 | test_default_serializer | def test_default_serializer(self):"""Test serializer with different object types."""assert _default_serializer("string") == "string"assert _default_serializer(123) == "123"class TestObj:def __init__(self):self.attr = "value"assert _default_serializer(TestObj()) == {"attr": "value"} | 1 | 6 | 1 | 38 | 0 | 50 | 59 | 50 | self | [] | None | {"Assign": 1, "Expr": 1} | 4 | 10 | 4 | ["_default_serializer", "_default_serializer", "_default_serializer", "TestObj"] | 0 | [] | The function (test_default_serializer) defined within the public class called TestUtilityFunctions.The function start at line 50 and ends at 59. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and I... |
aws-deadline_deadline-cloud | TestUtilityFunctions | public | 0 | 0 | test_default_error_handler | def test_default_error_handler(self):"""Test error handler formats errors correctly."""error = Exception("test error")result = _default_error_handler(error)assert result["error"] == "test error"assert result["type"] == "Exception" | 1 | 5 | 1 | 32 | 0 | 61 | 67 | 61 | self | [] | None | {"Assign": 2, "Expr": 1} | 2 | 7 | 2 | ["Exception", "_default_error_handler"] | 0 | [] | The function (test_default_error_handler) defined within the public class called TestUtilityFunctions.The function start at line 61 and ends at 67. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_wrapper.mock_func | def mock_func(param1: str, param2: int = 10):return {"param1": param1, "param2": param2} | 1 | 2 | 2 | 23 | 0 | 72 | 73 | 72 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_wrapper.mock_func) defined within the public class called public.The function start at line 72 and ends at 73. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [72.0] and does not return any value.. |
aws-deadline_deadline-cloud | TestUtilityFunctions | public | 0 | 0 | test_create_wrapper | def test_create_wrapper(self):"""Test wrapper creation and execution."""def mock_func(param1: str, param2: int = 10):return {"param1": param1, "param2": param2}config = ToolDefinition(func=mock_func,param_names=["param1", "param2"],)wrapper = _create_wrapper(config, _default_serializer, _default_error_handler)assert ca... | 1 | 11 | 1 | 66 | 0 | 69 | 86 | 69 | self | [] | Returns | {"Assign": 3, "Expr": 1, "Return": 1} | 6 | 18 | 6 | ["ToolDefinition", "_create_wrapper", "callable", "hasattr", "wrapper", "isinstance"] | 0 | [] | The function (test_create_wrapper) defined within the public class called TestUtilityFunctions.The function start at line 69 and ends at 86. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 6.0 functions, and ... |
aws-deadline_deadline-cloud | TestRegisterAPITools | public | 0 | 0 | test_basic_registration | def test_basic_registration(self):"""Test registering valid tools."""mock_app = MagicMock()# Clean up any existing markersif hasattr(api.list_farms, "_mcp_tool_registered"):delattr(api.list_farms, "_mcp_tool_registered")register_api_tools(mock_app, [api.list_farms])assert mock_app.tool.call_count == 1assert hasattr(api... | 2 | 8 | 1 | 64 | 0 | 92 | 106 | 92 | self | [] | None | {"Assign": 1, "Expr": 4, "If": 1} | 6 | 15 | 6 | ["MagicMock", "hasattr", "delattr", "register_api_tools", "hasattr", "delattr"] | 0 | [] | The function (test_basic_registration) defined within the public class called TestRegisterAPITools.The function start at line 92 and ends at 106. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 6.0 functions, and ... |
aws-deadline_deadline-cloud | TestRegisterAPITools | public | 0 | 0 | test_invalid_tools_raise_exception | def test_invalid_tools_raise_exception(self):"""Test that invalid tools raise exceptions."""mock_app = MagicMock()with pytest.raises(ValueError, match="Tool not_a_function is not callable"):register_api_tools(mock_app, ["not_a_function"])# type: ignore[list-item]mock_app.tool.assert_not_called() | 1 | 5 | 1 | 38 | 0 | 108 | 115 | 108 | self | [] | None | {"Assign": 1, "Expr": 3, "With": 1} | 4 | 8 | 4 | ["MagicMock", "pytest.raises", "register_api_tools", "mock_app.tool.assert_not_called"] | 0 | [] | The function (test_invalid_tools_raise_exception) defined within the public class called TestRegisterAPITools.The function start at line 108 and ends at 115. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_unregistered_function_raises_exception.unregistered_function | def unregistered_function():"""A function not in the registry."""pass | 1 | 2 | 0 | 6 | 0 | 121 | 123 | 121 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_unregistered_function_raises_exception.unregistered_function) defined within the public class called public.The function start at line 121 and ends at 123. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | TestRegisterAPITools | public | 0 | 0 | test_unregistered_function_raises_exception | def test_unregistered_function_raises_exception(self):"""Test that callable functions not in registry raise exceptions."""mock_app = MagicMock()def unregistered_function():"""A function not in the registry."""passwith pytest.raises(ValueError, match="Function unregistered_function not found in tool registry"):register_... | 1 | 8 | 1 | 40 | 0 | 117 | 130 | 117 | self | [] | None | {"Assign": 1, "Expr": 4, "With": 1} | 4 | 14 | 4 | ["MagicMock", "pytest.raises", "register_api_tools", "mock_app.tool.assert_not_called"] | 0 | [] | The function (test_unregistered_function_raises_exception) defined within the public class called TestRegisterAPITools.The function start at line 117 and ends at 130. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares... |
aws-deadline_deadline-cloud | TestParameterTypeConversion | public | 0 | 0 | test_signature_preserves_original_annotations | def test_signature_preserves_original_annotations(self):"""Test that MCP wrapper preserves original function type annotations."""from deadline._mcp.utils import _create_wrapperfrom deadline._mcp.tools.job import submit_jobfrom deadline._mcp.registry import ToolDefinition# Create a mock configconfig: ToolDefinition = {"... | 1 | 11 | 1 | 103 | 0 | 136 | 159 | 136 | self | [] | None | {"AnnAssign": 1, "Assign": 3, "Expr": 1} | 3 | 24 | 3 | ["_create_wrapper", "str", "getattr"] | 0 | [] | The function (test_signature_preserves_original_annotations) defined within the public class called TestParameterTypeConversion.The function start at line 136 and ends at 159. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. I... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | fixture_mock_telemetry_client | def fixture_mock_telemetry_client():"""Fixture to provide a mock telemetry client for MCP tests."""mock_client = MagicMock()mock_client.is_initialized = Truemock_client.event_queue = MagicMock()return mock_client | 1 | 5 | 0 | 24 | 1 | 16 | 21 | 16 | ['mock_client'] | Returns | {"Assign": 3, "Expr": 1, "Return": 1} | 3 | 6 | 3 | ["MagicMock", "MagicMock", "pytest.fixture"] | 0 | [] | The function (fixture_mock_telemetry_client) defined within the public class called public.The function start at line 16 and ends at 21. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It ha... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_telemetry_success | def test_mcp_tool_telemetry_success(mock_telemetry_client):"""Test that MCP tools record telemetry on successful execution."""mock_func = MagicMock()mock_func.__name__ = "test_function"mock_func.return_value = {"result": "success"}config: ToolDefinition = {"func": mock_func, "param_names": ["param1", "param2"]}mock_ser... | 5 | 32 | 1 | 232 | 10 | 24 | 64 | 24 | mock_telemetry_client | ['usage_details', 'calls', 'wrapper', 'latency_details', 'usage_call', 'latency_call', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 13, "Expr": 2, "With": 1} | 9 | 41 | 9 | ["MagicMock", "MagicMock", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with", "next", "next"] | 0 | [] | The function (test_mcp_tool_telemetry_success) defined within the public class called public.The function start at line 24 and ends at 64. It contains 32 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_telemetry_failure | def test_mcp_tool_telemetry_failure(mock_telemetry_client):"""Test that MCP tools record telemetry on failed execution."""mock_func = MagicMock()mock_func.__name__ = "test_function"mock_func.side_effect = ValueError("Test error")config: ToolDefinition = {"func": mock_func, "param_names": ["param1"]}mock_serializer = Ma... | 5 | 32 | 1 | 227 | 10 | 67 | 107 | 67 | mock_telemetry_client | ['usage_details', 'calls', 'wrapper', 'latency_details', 'usage_call', 'latency_call', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 13, "Expr": 2, "With": 1} | 10 | 41 | 10 | ["MagicMock", "ValueError", "MagicMock", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_error_handler.assert_called_once", "next", "next"] | 0 | [] | The function (test_mcp_tool_telemetry_failure) defined within the public class called public.The function start at line 67 and ends at 107. It contains 32 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It h... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_telemetry_error_handling | def test_mcp_tool_telemetry_error_handling(mock_telemetry_client):"""Test that telemetry errors don't affect tool execution."""mock_func = MagicMock()mock_func.__name__ = "test_function"mock_func.return_value = {"result": "success"}mock_telemetry_client.record_event.side_effect = Exception("Telemetry error")config: Too... | 1 | 17 | 1 | 121 | 5 | 110 | 134 | 110 | mock_telemetry_client | ['wrapper', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 9, "Expr": 2, "With": 1} | 8 | 25 | 8 | ["MagicMock", "Exception", "MagicMock", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with"] | 0 | [] | The function (test_mcp_tool_telemetry_error_handling) defined within the public class called public.The function start at line 110 and ends at 134. It contains 17 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, an... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_parameter_filtering | def test_mcp_tool_parameter_filtering():"""Test that empty/null parameters are filtered correctly."""mock_func = MagicMock()mock_func.__name__ = "test_function"mock_func.return_value = {"result": "success"}mock_telemetry_client = MagicMock()config: ToolDefinition = {"func": mock_func, "param_names": ["param1", "param2"... | 1 | 16 | 0 | 123 | 6 | 137 | 159 | 137 | ['wrapper', 'mock_telemetry_client', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 9, "Expr": 2, "With": 1} | 8 | 23 | 8 | ["MagicMock", "MagicMock", "MagicMock", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with"] | 0 | [] | The function (test_mcp_tool_parameter_filtering) defined within the public class called public.The function start at line 137 and ends at 159. It contains 16 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_telemetry_client_initialization_error | def test_mcp_tool_telemetry_client_initialization_error():"""Test behavior when telemetry client fails to initialize."""mock_func = MagicMock()mock_func.__name__ = "test_function"mock_func.return_value = {"result": "success"}config: ToolDefinition = {"func": mock_func, "param_names": ["param1"]}mock_serializer = MagicM... | 1 | 16 | 0 | 110 | 5 | 162 | 184 | 162 | ['wrapper', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 8, "Expr": 3, "With": 1} | 9 | 23 | 9 | ["MagicMock", "MagicMock", "MagicMock", "patch", "Exception", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with", "mock_get_client.assert_called"] | 0 | [] | The function (test_mcp_tool_telemetry_client_initialization_error) defined within the public class called public.The function start at line 162 and ends at 184. It contains 16 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 9.0 ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_aws_error_handling | def test_mcp_tool_aws_error_handling():"""Test that MCP tools properly handle AWS service errors."""mock_func = MagicMock()mock_func.__name__ = "list_farms"from botocore.exceptions import ClientErrorerror_response = {"Error": {"Code": "ValidationException", "Message": "Invalid farm ID format"},"ResponseMetadata": {"HTT... | 5 | 33 | 0 | 227 | 8 | 187 | 233 | 187 | ['error_response', 'usage_details', 'calls', 'wrapper', 'usage_call', 'mock_telemetry_client', 'result', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 11, "Expr": 2, "If": 1, "With": 1} | 8 | 47 | 8 | ["MagicMock", "ClientError", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with", "next"] | 0 | [] | The function (test_mcp_tool_aws_error_handling) defined within the public class called public.The function start at line 187 and ends at 233. It contains 33 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_network_error_handling | def test_mcp_tool_network_error_handling():"""Test that MCP tools properly handle network-related errors."""mock_func = MagicMock()mock_func.__name__ = "list_queues"from botocore.exceptions import ConnectTimeoutErrormock_func.side_effect = ConnectTimeoutError(endpoint_url="https://deadline.us-west-2.amazonaws.com")mock... | 4 | 29 | 0 | 199 | 7 | 236 | 277 | 236 | ['usage_details', 'calls', 'wrapper', 'usage_call', 'mock_telemetry_client', 'result', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 10, "Expr": 2, "With": 1} | 10 | 42 | 10 | ["MagicMock", "ConnectTimeoutError", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with", "lower", "lower", "next"] | 0 | [] | The function (test_mcp_tool_network_error_handling) defined within the public class called public.The function start at line 236 and ends at 277. It contains 29 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 10.0 functions, and... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_telemetry_event_structure | def test_mcp_tool_telemetry_event_structure(mock_telemetry_client):"""Test that MCP telemetry events have the correct structure."""mock_func = MagicMock()mock_func.__name__ = "list_farms"mock_func.return_value = {"farms": []}config: ToolDefinition = {"func": mock_func, "param_names": ["farmId"]}mock_serializer = MagicM... | 4 | 37 | 1 | 234 | 8 | 280 | 328 | 280 | mock_telemetry_client | ['event_type', 'calls', 'wrapper', 'event_details', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 11, "Expr": 2, "For": 1, "If": 2, "With": 1} | 10 | 49 | 10 | ["MagicMock", "MagicMock", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with", "event_type.startswith", "isinstance", "isinstance"] | 0 | [] | The function (test_mcp_tool_telemetry_event_structure) defined within the public class called public.The function start at line 280 and ends at 328. It contains 37 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 10.0 functions, ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_mcp_tool_telemetry_queue_integration | def test_mcp_tool_telemetry_queue_integration(mock_telemetry_client):"""Test that telemetry events are properly queued."""mock_func = MagicMock()mock_func.__name__ = "submit_job"mock_func.return_value = {"jobId": "job-0000001234567adba49becbca1fce5f6"}config: ToolDefinition = {"func": mock_func, "param_names": ["job_bu... | 2 | 20 | 1 | 139 | 7 | 331 | 358 | 331 | mock_telemetry_client | ['calls', 'wrapper', 'event_details', 'mock_error_handler', 'result', 'mock_serializer', 'mock_func'] | None | {"AnnAssign": 1, "Assign": 10, "Expr": 2, "For": 1, "With": 1} | 7 | 28 | 7 | ["MagicMock", "MagicMock", "MagicMock", "patch", "_create_wrapper", "wrapper", "mock_func.assert_called_once_with"] | 0 | [] | The function (test_mcp_tool_telemetry_queue_integration) defined within the public class called public.The function start at line 331 and ends at 358. It contains 20 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 7.0 functions,... |
VectorInstitute_vector-inference | public | public | 0 | 0 | filter_throughput | def filter_throughput(log_file_path: str) -> None:"""Filter log file for non-zero entries and calculate the avg throughput."""avg_prompt_throughput = []avg_generation_throughput = []# Define a regular expression pattern to extract throughput valuespattern = r"Avg prompt throughput: ([^,]+) tokens/s, Avg generation thro... | 5 | 20 | 1 | 112 | 6 | 7 | 36 | 7 | log_file_path | ['pattern', 'generation_throughput', 'match', 'prompt_throughput', 'avg_generation_throughput', 'avg_prompt_throughput'] | None | {"Assign": 6, "Expr": 5, "For": 1, "If": 3, "With": 1} | 16 | 30 | 16 | ["open", "re.search", "strip", "match.group", "strip", "match.group", "avg_prompt_throughput.append", "float", "avg_generation_throughput.append", "float", "print", "sum", "len", "print", "sum", "len"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95055886_VectorInstitute_vector_inference.profile.avg_throughput_py.main"] | The function (filter_throughput) defined within the public class called public.The function start at line 7 and ends at 36. It contains 20 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 16.0 functions, It has 16.0 functions cal... |
VectorInstitute_vector-inference | public | public | 0 | 0 | main | def main() -> None:"""Run the main function."""# Create the parserparser = argparse.ArgumentParser(description="Filter log file for non-zero throughput entries.")# Add the argumentsparser.add_argument("--path", type=str, help="The path to the log file")# Execute the parse_args() methodargs = parser.parse_args()# Use th... | 1 | 7 | 0 | 44 | 2 | 39 | 53 | 39 | ['parser', 'args'] | None | {"Assign": 2, "Expr": 3} | 4 | 15 | 4 | ["argparse.ArgumentParser", "parser.add_argument", "parser.parse_args", "filter_throughput"] | 304 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3494570_keirf_greaseweazle.src.greaseweazle.cli_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.third_party.pystache.tests.test_commands_py.CommandsTestCase.callScript", "_.... | The function (main) defined within the public class called public.The function start at line 39 and ends at 53. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside whic... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | send_request | def send_request(prompt: List[str]) -> Union[float, None]:"""Send a request to the API."""data = {"model": f"{MODEL_PATH}", "prompt": prompt, "max_tokens": 100}start_time = time.time()response = requests.post(f"{ENDPOINT}/completions", headers=HEADERS, json=data)duration = time.time() - start_timeif response.status_cod... | 2 | 8 | 1 | 78 | 4 | 78 | 86 | 78 | prompt | ['start_time', 'duration', 'data', 'response'] | Union[float, None] | {"Assign": 4, "Expr": 1, "If": 1, "Return": 2} | 3 | 9 | 3 | ["time.time", "requests.post", "time.time"] | 6 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3677969_eventbrite_pysoa.tests.integration.test_send_receive_py.CatchExceptionOnRequestMiddleware.request", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3677969_eventbrite_pysoa.tests.integration.test_send_receive_... | The function (send_request) defined within the public class called public.The function start at line 78 and ends at 86. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called ins... |
VectorInstitute_vector-inference | public | public | 0 | 0 | main | def main() -> None:"""Run main function."""for _ in range(10):print("Sending 20x requests 0-52...")send_request(PROMPTS * 20)print("Done!") | 2 | 5 | 0 | 29 | 0 | 89 | 94 | 89 | [] | None | {"Expr": 4, "For": 1} | 4 | 6 | 4 | ["range", "print", "send_request", "print"] | 304 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3494570_keirf_greaseweazle.src.greaseweazle.cli_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.third_party.pystache.tests.test_commands_py.CommandsTestCase.callScript", "_.... | The function (main) defined within the public class called public.The function start at line 89 and ends at 94. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside whic... | |
VectorInstitute_vector-inference | TestVecInfImports | public | 0 | 1 | test_imports | def test_imports(self):"""Test that all modules can be imported."""try:# CLI importsimport vec_inf.cli# noqa: PLC0415import vec_inf.cli._cli# noqa: PLC0415import vec_inf.cli._helper# noqa: PLC0415# Client importsimport vec_inf.client# noqa: PLC0415import vec_inf.client._client_vars# noqa: F401, PLC0415import vec_inf.cl... | 2 | 18 | 1 | 100 | 0 | 11 | 33 | 11 | self | [] | None | {"Expr": 2, "Try": 1} | 1 | 23 | 1 | ["pytest.fail"] | 0 | [] | The function (test_imports) defined within the public class called TestVecInfImports, that inherit another class.The function start at line 11 and ends at 33. It contains 18 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 fun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.