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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VectorInstitute_vector-inference | public | public | 0 | 0 | runner | def runner():"""Fixture for invoking CLI commands."""return CliRunner() | 1 | 2 | 0 | 9 | 0 | 13 | 15 | 13 | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 3 | 1 | ["CliRunner"] | 6 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.21593641_openforcefield_openff_fragmenter.openff.fragmenter._version_py.git_pieces_from_vcs", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.21593641_openforcefield_openff_fragmenter.versioneer_py.git_pieces_from_vcs... | The function (runner) defined within the public class called public.The function start at line 13 and ends at 15. It contains 2 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 declare 1.0 function, It has 1.0 function called inside w... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_launch_command_success | def test_launch_command_success(runner):"""Test successful model launch with minimal required arguments."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:# Mock the client instancemock_client = MagicMock()mock_client_class.return_value = mock_client# Mock the launch response - ensure numeric values ar... | 1 | 27 | 1 | 143 | 3 | 18 | 51 | 18 | runner | ['result', 'mock_response', 'mock_client'] | None | {"Assign": 6, "Expr": 2, "With": 1} | 5 | 34 | 5 | ["patch", "MagicMock", "MagicMock", "runner.invoke", "mock_client.launch_model.assert_called_once"] | 0 | [] | The function (test_launch_command_success) defined within the public class called public.The function start at line 18 and ends at 51. It contains 27 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... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_launch_command_with_json_output | def test_launch_command_with_json_output(runner):"""Test JSON output format for launch command."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_response = MagicMock()mock_response.config = {"slurm_job_id": "14933051","model_nam... | 1 | 17 | 1 | 108 | 4 | 54 | 74 | 54 | runner | ['output', 'result', 'mock_response', 'mock_client'] | None | {"Assign": 7, "Expr": 1, "With": 1} | 7 | 21 | 7 | ["patch", "MagicMock", "MagicMock", "runner.invoke", "json.loads", "output.get", "output.get"] | 0 | [] | The function (test_launch_command_with_json_output) defined within the public class called public.The function start at line 54 and ends at 74. 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 7.0 functions, and I... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_launch_command_model_not_found | def test_launch_command_model_not_found(runner):"""Test handling of a model that's neither in config nor has weights."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_client# Mock the client to raise an exceptionmock_client.launch_model.si... | 1 | 11 | 1 | 61 | 2 | 77 | 92 | 77 | runner | ['result', 'mock_client'] | None | {"Assign": 4, "Expr": 1, "With": 1} | 4 | 16 | 4 | ["patch", "MagicMock", "Exception", "runner.invoke"] | 0 | [] | The function (test_launch_command_model_not_found) defined within the public class called public.The function start at line 77 and ends at 92. 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. It declares 4.0 functions, and It... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_list_all_models | def test_list_all_models(runner):"""Test listing all available models."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_model_info = MagicMock()mock_model_info.name = "Meta-Llama-3.1-8B"mock_model_info.family = "Meta-Llama-3.1"m... | 1 | 13 | 1 | 82 | 3 | 95 | 111 | 95 | runner | ['result', 'mock_model_info', 'mock_client'] | None | {"Assign": 9, "Expr": 1, "With": 1} | 4 | 17 | 4 | ["patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_list_all_models) defined within the public class called public.The function start at line 95 and ends at 111. It contains 13 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 has 4.0 funct... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_list_single_model | def test_list_single_model(runner):"""Test displaying details for a specific model."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_config = MagicMock()mock_config.model_dump.return_value = {"model_name": "Meta-Llama-3.1-8B","m... | 1 | 16 | 1 | 94 | 3 | 114 | 133 | 114 | runner | ['result', 'mock_config', 'mock_client'] | None | {"Assign": 6, "Expr": 1, "With": 1} | 4 | 20 | 4 | ["patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_list_single_model) defined within the public class called public.The function start at line 114 and ends at 133. 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 4.0 functions, and It has 4.0 fu... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_status_command | def test_status_command(runner):"""Test status command."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_status = MagicMock()mock_status.model_name = "Meta-Llama-3.1-8B"mock_status.server_status = "READY"mock_status.base_url = "... | 1 | 14 | 1 | 87 | 3 | 136 | 153 | 136 | runner | ['result', 'mock_status', 'mock_client'] | None | {"Assign": 10, "Expr": 1, "With": 1} | 4 | 18 | 4 | ["patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_status_command) defined within the public class called public.The function start at line 136 and ends at 153. It contains 14 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 has 4.0 funct... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_shutdown_command | def test_shutdown_command(runner):"""Test shutdown command."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_client# Mock shutdown to not raise exceptionmock_client.shutdown_model.return_value = Noneresult = runner.invoke(cli, ["shutdown",... | 1 | 8 | 1 | 57 | 2 | 156 | 168 | 156 | runner | ['result', 'mock_client'] | None | {"Assign": 4, "Expr": 1, "With": 1} | 3 | 13 | 3 | ["patch", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_shutdown_command) defined within the public class called public.The function start at line 156 and ends at 168. 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, and It has 3.0 func... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_metrics_command_pending_server | def test_metrics_command_pending_server(runner):"""Test metrics command when server is pending."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_response = MagicMock()mock_response.metrics = "ERROR: Pending resources for server ... | 1 | 10 | 1 | 67 | 3 | 171 | 184 | 171 | runner | ['result', 'mock_response', 'mock_client'] | None | {"Assign": 6, "Expr": 1, "With": 1} | 4 | 14 | 4 | ["patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_metrics_command_pending_server) defined within the public class called public.The function start at line 171 and ends at 184. 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 4.0 functions, and ... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_metrics_command_server_ready | def test_metrics_command_server_ready(runner):"""Test metrics command when server is ready and returning metrics."""with (patch("vec_inf.cli._cli.VecInfClient") as mock_client_class,patch("vec_inf.cli._cli.time.sleep", side_effect=KeyboardInterrupt),):mock_client = MagicMock()mock_client_class.return_value = mock_clien... | 1 | 16 | 1 | 100 | 3 | 187 | 209 | 187 | runner | ['result', 'mock_response', 'mock_client'] | None | {"Assign": 6, "Expr": 1, "With": 1} | 5 | 23 | 5 | ["patch", "patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_metrics_command_server_ready) defined within the public class called public.The function start at line 187 and ends at 209. 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, and It... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_cli_cleanup_logs_dry_run | def test_cli_cleanup_logs_dry_run(runner, tmp_path):"""Test CLI cleanup command in dry-run mode."""model_dir = tmp_path / "fam_a" / "model_a.123"model_dir.mkdir(parents=True)with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_client.... | 1 | 22 | 2 | 93 | 3 | 212 | 237 | 212 | runner,tmp_path | ['result', 'mock_client', 'model_dir'] | None | {"Assign": 5, "Expr": 2, "With": 1} | 5 | 26 | 5 | ["model_dir.mkdir", "patch", "MagicMock", "runner.invoke", "str"] | 0 | [] | The function (test_cli_cleanup_logs_dry_run) defined within the public class called public.The function start at line 212 and ends at 237. It contains 22 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [212.0] and does not return any value. It declares 5.0 functions, and It... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_cli_cleanup_logs_delete | def test_cli_cleanup_logs_delete(runner, tmp_path):"""Test cleanup_logs CLI deletes matching directories when not in dry-run mode."""fam_dir = tmp_path / "fam_a"fam_dir.mkdir()model_dir = fam_dir / "model_a.1"model_dir.mkdir()with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock... | 1 | 25 | 2 | 100 | 4 | 240 | 268 | 240 | runner,tmp_path | ['result', 'fam_dir', 'mock_client', 'model_dir'] | None | {"Assign": 6, "Expr": 3, "With": 1} | 6 | 29 | 6 | ["fam_dir.mkdir", "model_dir.mkdir", "patch", "MagicMock", "runner.invoke", "str"] | 0 | [] | The function (test_cli_cleanup_logs_delete) defined within the public class called public.The function start at line 240 and ends at 268. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [240.0] and does not return any value. It declares 6.0 functions, and It ... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_cli_cleanup_logs_no_match | def test_cli_cleanup_logs_no_match(runner, tmp_path):"""Test cleanup_logs CLI when no directories match the filters."""fam_dir = tmp_path / "fam_a"fam_dir.mkdir()(fam_dir / "model_a.1").mkdir()with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock... | 1 | 20 | 2 | 90 | 3 | 271 | 294 | 271 | runner,tmp_path | ['result', 'fam_dir', 'mock_client'] | None | {"Assign": 5, "Expr": 3, "With": 1} | 6 | 24 | 6 | ["fam_dir.mkdir", "mkdir", "patch", "MagicMock", "runner.invoke", "str"] | 0 | [] | The function (test_cli_cleanup_logs_no_match) defined within the public class called public.The function start at line 271 and ends at 294. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [271.0] and does not return any value. It declares 6.0 functions, and I... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_command_success | def test_batch_launch_command_success(runner):"""Test successful batch model launch with multiple models."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_response = MagicMock()mock_response.config = {"slurm_job_id": "14933053",... | 1 | 39 | 1 | 169 | 3 | 297 | 339 | 297 | runner | ['result', 'mock_response', 'mock_client'] | None | {"Assign": 6, "Expr": 1, "With": 1} | 4 | 43 | 4 | ["patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_batch_launch_command_success) defined within the public class called public.The function start at line 297 and ends at 339. It contains 39 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... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_command_with_json_output | def test_batch_launch_command_with_json_output(runner):"""Test JSON output format for batch launch command."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_response = MagicMock()mock_response.config = {"slurm_job_id": "14933051... | 1 | 17 | 1 | 89 | 3 | 342 | 362 | 342 | runner | ['result', 'mock_response', 'mock_client'] | None | {"Assign": 6, "Expr": 1, "With": 1} | 4 | 21 | 4 | ["patch", "MagicMock", "MagicMock", "runner.invoke"] | 0 | [] | The function (test_batch_launch_command_with_json_output) defined within the public class called public.The function start at line 342 and ends at 362. 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 4.0 functions... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_command_model_not_found | def test_batch_launch_command_model_not_found(runner):"""Test batch launch when one of the models is not found."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_client.batch_launch_models.side_effect = Exception("'unknown-model'... | 1 | 12 | 1 | 62 | 2 | 365 | 380 | 365 | runner | ['result', 'mock_client'] | None | {"Assign": 4, "Expr": 1, "With": 1} | 4 | 16 | 4 | ["patch", "MagicMock", "Exception", "runner.invoke"] | 0 | [] | The function (test_batch_launch_command_model_not_found) defined within the public class called public.The function start at line 365 and ends at 380. It contains 12 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,... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_command_slurm_error | def test_batch_launch_command_slurm_error(runner):"""Test batch launch when SLURM job submission fails."""with patch("vec_inf.cli._cli.VecInfClient") as mock_client_class:mock_client = MagicMock()mock_client_class.return_value = mock_clientmock_client.batch_launch_models.side_effect = Exception("sbatch: error: Invalid ... | 1 | 12 | 1 | 62 | 2 | 383 | 398 | 383 | runner | ['result', 'mock_client'] | None | {"Assign": 4, "Expr": 1, "With": 1} | 4 | 16 | 4 | ["patch", "MagicMock", "Exception", "runner.invoke"] | 0 | [] | The function (test_batch_launch_command_slurm_error) defined within the public class called public.The function start at line 383 and ends at 398. It contains 12 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... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_command_no_models | def test_batch_launch_command_no_models(runner):"""Test batch launch with no models specified."""result = runner.invoke(cli, ["batch-launch"])# Should fail because no models were specifiedassert result.exit_code != 0 | 1 | 3 | 1 | 24 | 1 | 401 | 406 | 401 | runner | ['result'] | None | {"Assign": 1, "Expr": 1} | 1 | 6 | 1 | ["runner.invoke"] | 0 | [] | The function (test_batch_launch_command_no_models) defined within the public class called public.The function start at line 401 and ends at 406. 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 ... |
VectorInstitute_vector-inference | TestLaunchResponseFormatter | public | 0 | 0 | test_format_table_output | def test_format_table_output(self):"""Test formatting launch response as a table."""model_name = "Meta-Llama-3.1-8B"params = {"slurm_job_id": "14933053","model_type": "LLM","vocab_size": "128000","partition": "gpu","qos": "normal","time": "1:00:00","num_nodes": "1","gpus_per_node": "1","cpus_per_task": "8","mem_per_nod... | 1 | 22 | 1 | 112 | 0 | 22 | 48 | 22 | self | [] | None | {"Assign": 4, "Expr": 1} | 4 | 27 | 4 | ["LaunchResponseFormatter", "formatter.format_table_output", "isinstance", "len"] | 0 | [] | The function (test_format_table_output) defined within the public class called TestLaunchResponseFormatter.The function start at line 22 and ends at 48. It contains 22 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 function... |
VectorInstitute_vector-inference | TestLaunchResponseFormatter | public | 0 | 0 | test_format_table_output_with_minimal_params | def test_format_table_output_with_minimal_params(self):"""Test formatting with minimal required parameters."""model_name = "test-model"params = {"slurm_job_id": "12345","model_type": "LLM","vocab_size": "50000","partition": "cpu","qos": "low","time": "30:00","num_nodes": "1","gpus_per_node": "0","cpus_per_task": "4","m... | 1 | 22 | 1 | 102 | 0 | 50 | 74 | 50 | self | [] | None | {"Assign": 4, "Expr": 1} | 4 | 25 | 4 | ["LaunchResponseFormatter", "formatter.format_table_output", "isinstance", "len"] | 0 | [] | The function (test_format_table_output_with_minimal_params) defined within the public class called TestLaunchResponseFormatter.The function start at line 50 and ends at 74. It contains 22 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 d... |
VectorInstitute_vector-inference | TestLaunchResponseFormatter | public | 0 | 0 | test_format_table_output | def test_format_table_output(self):"""Test formatting batch launch response as a table."""params = {"slurm_job_id": "14933053","slurm_job_name": "BATCH-job","model_names": ["model1", "model2"],"log_dir": "/tmp/logs",# Moved to top level"models": {"model1": {"model_name": "model1","partition": "gpu","qos": "normal","tim... | 1 | 33 | 1 | 138 | 0 | 80 | 115 | 80 | self | [] | None | {"Assign": 4, "Expr": 1} | 4 | 27 | 4 | ["LaunchResponseFormatter", "formatter.format_table_output", "isinstance", "len"] | 0 | [] | The function (test_format_table_output) defined within the public class called TestLaunchResponseFormatter.The function start at line 80 and ends at 115. It contains 33 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 functio... |
VectorInstitute_vector-inference | TestBatchLaunchResponseFormatter | public | 0 | 0 | test_format_table_output_single_model | def test_format_table_output_single_model(self):"""Test formatting batch launch with single model."""params = {"slurm_job_id": "12345","slurm_job_name": "SINGLE-job","model_names": ["single-model"],"log_dir": "/logs",# Moved to top level"models": {"single-model": {"model_name": "single-model","partition": "cpu","qos": ... | 1 | 23 | 1 | 98 | 0 | 117 | 142 | 117 | self | [] | None | {"Assign": 3, "Expr": 1} | 4 | 26 | 4 | ["BatchLaunchResponseFormatter", "formatter.format_table_output", "isinstance", "len"] | 0 | [] | The function (test_format_table_output_single_model) defined within the public class called TestBatchLaunchResponseFormatter.The function start at line 117 and ends at 142. It contains 23 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 d... |
VectorInstitute_vector-inference | TestStatusResponseFormatter | public | 0 | 0 | test_output_table_ready_status | def test_output_table_ready_status(self):"""Test formatting status response for ready server."""status_info = StatusResponse(model_name="Meta-Llama-3.1-8B",log_dir="/tmp/logs",server_status="READY",job_state="RUNNING",raw_output="JobState=RUNNING",base_url="http://localhost:8000",pending_reason=None,failed_reason=None,... | 1 | 15 | 1 | 72 | 0 | 148 | 165 | 148 | self | [] | None | {"Assign": 3, "Expr": 1} | 5 | 18 | 5 | ["StatusResponse", "StatusResponseFormatter", "formatter.output_table", "isinstance", "len"] | 0 | [] | The function (test_output_table_ready_status) defined within the public class called TestStatusResponseFormatter.The function start at line 148 and ends at 165. It contains 15 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 ... |
VectorInstitute_vector-inference | TestStatusResponseFormatter | public | 0 | 0 | test_output_table_pending_status | def test_output_table_pending_status(self):"""Test formatting status response for pending server."""status_info = StatusResponse(model_name="test-model",log_dir="/tmp/logs",server_status="PENDING",job_state="PENDING",raw_output="JobState=PENDING",base_url=None,pending_reason="Waiting for resources",failed_reason=None,)... | 1 | 15 | 1 | 72 | 0 | 167 | 184 | 167 | self | [] | None | {"Assign": 3, "Expr": 1} | 5 | 18 | 5 | ["StatusResponse", "StatusResponseFormatter", "formatter.output_table", "isinstance", "len"] | 0 | [] | The function (test_output_table_pending_status) defined within the public class called TestStatusResponseFormatter.The function start at line 167 and ends at 184. It contains 15 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.... |
VectorInstitute_vector-inference | TestStatusResponseFormatter | public | 0 | 0 | test_output_table_failed_status | def test_output_table_failed_status(self):"""Test formatting status response for failed server."""status_info = StatusResponse(model_name="failed-model",log_dir="/tmp/logs",server_status="FAILED",job_state="FAILED",raw_output="JobState=FAILED",base_url=None,pending_reason=None,failed_reason="Out of memory",)formatter =... | 1 | 15 | 1 | 72 | 0 | 186 | 203 | 186 | self | [] | None | {"Assign": 3, "Expr": 1} | 5 | 18 | 5 | ["StatusResponse", "StatusResponseFormatter", "formatter.output_table", "isinstance", "len"] | 0 | [] | The function (test_output_table_failed_status) defined within the public class called TestStatusResponseFormatter.The function start at line 186 and ends at 203. It contains 15 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... |
VectorInstitute_vector-inference | TestStatusResponseFormatter | public | 0 | 0 | test_output_json_ready_status | def test_output_json_ready_status(self, mock_echo):"""Test JSON output for ready server status."""status_info = StatusResponse(model_name="Meta-Llama-3.1-8B",log_dir="/tmp/logs",server_status="READY",job_state="RUNNING",raw_output="JobState=RUNNING",base_url="http://localhost:8000",pending_reason=None,failed_reason=Non... | 1 | 18 | 2 | 91 | 0 | 206 | 227 | 206 | self,mock_echo | [] | None | {"Assign": 4, "Expr": 3} | 7 | 22 | 7 | ["StatusResponse", "StatusResponseFormatter", "formatter.output_json", "mock_echo.assert_called_once", "json.loads", "isinstance", "patch"] | 0 | [] | The function (test_output_json_ready_status) defined within the public class called TestStatusResponseFormatter.The function start at line 206 and ends at 227. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [206.0] and does not return any value. It declares 7... |
VectorInstitute_vector-inference | TestStatusResponseFormatter | public | 0 | 0 | test_output_json_with_error_reasons | def test_output_json_with_error_reasons(self, mock_echo):"""Test JSON output with error reasons."""status_info = StatusResponse(model_name="test-model",log_dir="/tmp/logs",server_status="FAILED",job_state="FAILED",raw_output="JobState=FAILED",base_url=None,pending_reason="Resource allocation",failed_reason="Configurati... | 1 | 19 | 2 | 95 | 0 | 230 | 251 | 230 | self,mock_echo | [] | None | {"Assign": 4, "Expr": 3} | 7 | 22 | 7 | ["StatusResponse", "StatusResponseFormatter", "formatter.output_json", "mock_echo.assert_called_once", "json.loads", "isinstance", "patch"] | 0 | [] | The function (test_output_json_with_error_reasons) defined within the public class called TestStatusResponseFormatter.The function start at line 230 and ends at 251. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [230.0] and does not return any value. It decl... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_format_metrics_basic | def test_format_metrics_basic(self):"""Test formatting basic metrics."""metrics = {"prompt_tokens_per_sec": 100.5,"generation_tokens_per_sec": 250.2,"requests_running": 3,"requests_waiting": 1,"requests_swapped": 0,"gpu_cache_usage": 0.75,"cpu_cache_usage": 0.25,"total_prompt_tokens": 1000,"total_generation_tokens": 25... | 1 | 17 | 1 | 89 | 0 | 257 | 276 | 257 | self | [] | None | {"Assign": 2, "Expr": 2} | 4 | 20 | 4 | ["MetricsResponseFormatter", "formatter.format_metrics", "isinstance", "len"] | 0 | [] | The function (test_format_metrics_basic) defined within the public class called TestMetricsResponseFormatter.The function start at line 257 and ends at 276. 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 4.0 func... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_format_metrics_with_prefix_caching | def test_format_metrics_with_prefix_caching(self):"""Test formatting metrics with prefix caching enabled."""metrics = {"prompt_tokens_per_sec": 100.0,"generation_tokens_per_sec": 200.0,"requests_running": 2,"requests_waiting": 0,"requests_swapped": 0,"gpu_cache_usage": 0.5,"cpu_cache_usage": 0.1,"gpu_prefix_cache_hit_r... | 1 | 20 | 1 | 107 | 0 | 278 | 300 | 278 | self | [] | None | {"Assign": 2, "Expr": 2} | 4 | 23 | 4 | ["MetricsResponseFormatter", "formatter.format_metrics", "isinstance", "len"] | 0 | [] | The function (test_format_metrics_with_prefix_caching) defined within the public class called TestMetricsResponseFormatter.The function start at line 278 and ends at 300. It contains 20 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 dec... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_format_metrics_with_latency | def test_format_metrics_with_latency(self):"""Test formatting metrics with latency information."""metrics = {"prompt_tokens_per_sec": 150.0,"generation_tokens_per_sec": 300.0,"requests_running": 1,"requests_waiting": 0,"requests_swapped": 0,"gpu_cache_usage": 0.3,"cpu_cache_usage": 0.1,"avg_request_latency": 2.5,"total... | 1 | 18 | 1 | 95 | 0 | 302 | 322 | 302 | self | [] | None | {"Assign": 2, "Expr": 2} | 4 | 21 | 4 | ["MetricsResponseFormatter", "formatter.format_metrics", "isinstance", "len"] | 0 | [] | The function (test_format_metrics_with_latency) defined within the public class called TestMetricsResponseFormatter.The function start at line 302 and ends at 322. 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 declares 4... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_format_failed_metrics | def test_format_failed_metrics(self):"""Test formatting failed metrics with error message."""error_message = "ERROR: Server not ready"formatter = MetricsResponseFormatter(error_message)formatter.format_failed_metrics(error_message)assert isinstance(formatter.table, Table)assert len(formatter.table.rows) > 0 | 1 | 6 | 1 | 41 | 0 | 324 | 332 | 324 | self | [] | None | {"Assign": 2, "Expr": 2} | 4 | 9 | 4 | ["MetricsResponseFormatter", "formatter.format_failed_metrics", "isinstance", "len"] | 0 | [] | The function (test_format_failed_metrics) defined within the public class called TestMetricsResponseFormatter.The function start at line 324 and ends at 332. 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 func... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_set_metrics_with_string | def test_set_metrics_with_string(self):"""Test _set_metrics with string input."""formatter = MetricsResponseFormatter("Error message")assert formatter.metrics == {} | 1 | 3 | 1 | 19 | 0 | 334 | 337 | 334 | self | [] | None | {"Assign": 1, "Expr": 1} | 1 | 4 | 1 | ["MetricsResponseFormatter"] | 0 | [] | The function (test_set_metrics_with_string) defined within the public class called TestMetricsResponseFormatter.The function start at line 334 and ends at 337. 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 fun... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_set_metrics_with_dict | def test_set_metrics_with_dict(self):"""Test _set_metrics with dictionary input."""metrics_dict = {"prompt_tokens_per_sec": 100.0}formatter = MetricsResponseFormatter(metrics_dict)assert formatter.metrics == metrics_dict | 1 | 4 | 1 | 27 | 0 | 339 | 343 | 339 | self | [] | None | {"Assign": 2, "Expr": 1} | 1 | 5 | 1 | ["MetricsResponseFormatter"] | 0 | [] | The function (test_set_metrics_with_dict) defined within the public class called TestMetricsResponseFormatter.The function start at line 339 and ends at 343. 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 funct... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_check_prefix_caching_enabled | def test_check_prefix_caching_enabled(self):"""Test prefix caching detection when enabled."""metrics = {"gpu_prefix_cache_hit_rate": 0.8}formatter = MetricsResponseFormatter(metrics)assert formatter.enabled_prefix_caching is True | 1 | 4 | 1 | 27 | 0 | 345 | 349 | 345 | self | [] | None | {"Assign": 2, "Expr": 1} | 1 | 5 | 1 | ["MetricsResponseFormatter"] | 0 | [] | The function (test_check_prefix_caching_enabled) defined within the public class called TestMetricsResponseFormatter.The function start at line 345 and ends at 349. 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.... |
VectorInstitute_vector-inference | TestMetricsResponseFormatter | public | 0 | 0 | test_check_prefix_caching_disabled | def test_check_prefix_caching_disabled(self):"""Test prefix caching detection when disabled."""metrics = {"prompt_tokens_per_sec": 100.0}formatter = MetricsResponseFormatter(metrics)assert formatter.enabled_prefix_caching is False | 1 | 4 | 1 | 27 | 0 | 351 | 355 | 351 | self | [] | None | {"Assign": 2, "Expr": 1} | 1 | 5 | 1 | ["MetricsResponseFormatter"] | 0 | [] | The function (test_check_prefix_caching_disabled) defined within the public class called TestMetricsResponseFormatter.The function start at line 351 and ends at 355. 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... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_init | def test_init(self):"""Test ListCmdDisplay initialization."""console = Console()display = ListCmdDisplay(console, json_mode=False)assert display.console is consoleassert display.json_mode is Falseassert display.model_config is Noneassert display.model_names == [] | 1 | 7 | 1 | 46 | 0 | 361 | 369 | 361 | self | [] | None | {"Assign": 2, "Expr": 1} | 2 | 9 | 2 | ["Console", "ListCmdDisplay"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3564484_cornell_brg_pydgin.riscv.riscv_sim_py.RiscVSim.init_state"] | The function (test_init) defined within the public class called TestListCmdDisplay.The function start at line 361 and ends at 369. 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 2.0 functions, It has 2.0 functions... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_init_json_mode | def test_init_json_mode(self):"""Test ListCmdDisplay initialization with JSON mode."""console = Console()display = ListCmdDisplay(console, json_mode=True)assert display.json_mode is True | 1 | 4 | 1 | 27 | 0 | 371 | 376 | 371 | self | [] | None | {"Assign": 2, "Expr": 1} | 2 | 6 | 2 | ["Console", "ListCmdDisplay"] | 0 | [] | The function (test_init_json_mode) defined within the public class called TestListCmdDisplay.The function start at line 371 and ends at 376. 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 2.0 functions, and It ha... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_format_single_model_output_table | def test_format_single_model_output_table(self):"""Test formatting single model output as table."""console = Console()display = ListCmdDisplay(console, json_mode=False)# Create a mock ModelConfigmock_config = MagicMock(spec=ModelConfig)mock_config.model_dump.return_value = {"model_name": "Meta-Llama-3.1-8B","model_fami... | 1 | 16 | 1 | 93 | 0 | 378 | 398 | 378 | self | [] | None | {"Assign": 5, "Expr": 1} | 6 | 21 | 6 | ["Console", "ListCmdDisplay", "MagicMock", "display._format_single_model_output", "isinstance", "len"] | 0 | [] | The function (test_format_single_model_output_table) defined within the public class called TestListCmdDisplay.The function start at line 378 and ends at 398. 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 6.0 fu... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_format_single_model_output_json | def test_format_single_model_output_json(self):"""Test formatting single model output as JSON."""console = Console()display = ListCmdDisplay(console, json_mode=True)# Create a mock ModelConfigmock_config = MagicMock(spec=ModelConfig)mock_config.model_dump.return_value = {"model_name": "Meta-Llama-3.1-8B","model_family"... | 1 | 18 | 1 | 103 | 0 | 400 | 423 | 400 | self | [] | None | {"Assign": 6, "Expr": 1} | 6 | 24 | 6 | ["Console", "ListCmdDisplay", "MagicMock", "display._format_single_model_output", "isinstance", "json.loads"] | 0 | [] | The function (test_format_single_model_output_json) defined within the public class called TestListCmdDisplay.The function start at line 400 and ends at 423. 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 declares 6.0 fun... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_format_all_models_output | def test_format_all_models_output(self):"""Test formatting all models output."""console = Console()display = ListCmdDisplay(console, json_mode=False)# Create mock ModelInfo objectsmodel_info1 = MagicMock(spec=ModelInfo)model_info1.name = "Meta-Llama-3.1-8B"model_info1.family = "Meta-Llama-3.1"model_info1.model_type = "... | 1 | 17 | 1 | 106 | 0 | 425 | 448 | 425 | self | [] | None | {"Assign": 14, "Expr": 1} | 7 | 24 | 7 | ["Console", "ListCmdDisplay", "MagicMock", "MagicMock", "display._format_all_models_output", "isinstance", "len"] | 0 | [] | The function (test_format_all_models_output) defined within the public class called TestListCmdDisplay.The function start at line 425 and ends at 448. 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 7.0 functions,... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_display_single_model_output_json | def test_display_single_model_output_json(self, mock_echo):"""Test displaying single model output in JSON mode."""console = Console()display = ListCmdDisplay(console, json_mode=True)mock_config = MagicMock(spec=ModelConfig)mock_config.model_dump.return_value = {"model_name": "test-model","model_family": "test-family","... | 1 | 15 | 2 | 79 | 0 | 451 | 469 | 451 | self,mock_echo | [] | None | {"Assign": 4, "Expr": 3} | 6 | 19 | 6 | ["Console", "ListCmdDisplay", "MagicMock", "display.display_single_model_output", "mock_echo.assert_called_once", "patch"] | 0 | [] | The function (test_display_single_model_output_json) defined within the public class called TestListCmdDisplay.The function start at line 451 and ends at 469. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [451.0] and does not return any value. It declares 6.... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_display_single_model_output_table | def test_display_single_model_output_table(self):"""Test displaying single model output in table mode."""console = Console()display = ListCmdDisplay(console, json_mode=False)mock_config = MagicMock(spec=ModelConfig)mock_config.model_dump.return_value = {"model_name": "test-model","model_family": "test-family","model_ty... | 1 | 16 | 1 | 89 | 0 | 471 | 490 | 471 | self | [] | None | {"Assign": 4, "Expr": 3, "With": 1} | 6 | 20 | 6 | ["Console", "ListCmdDisplay", "MagicMock", "patch.object", "display.display_single_model_output", "mock_print.assert_called_once"] | 0 | [] | The function (test_display_single_model_output_table) defined within the public class called TestListCmdDisplay.The function start at line 471 and ends at 490. 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 6.0 f... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_display_all_models_output_json | def test_display_all_models_output_json(self, mock_echo):"""Test displaying all models output in JSON mode."""console = Console()display = ListCmdDisplay(console, json_mode=True)model_info = MagicMock(spec=ModelInfo)model_info.name = "test-model"model_infos = [model_info]display.display_all_models_output(model_infos)mo... | 1 | 8 | 2 | 52 | 0 | 493 | 504 | 493 | self,mock_echo | [] | None | {"Assign": 5, "Expr": 3} | 6 | 12 | 6 | ["Console", "ListCmdDisplay", "MagicMock", "display.display_all_models_output", "mock_echo.assert_called_once", "patch"] | 0 | [] | The function (test_display_all_models_output_json) defined within the public class called TestListCmdDisplay.The function start at line 493 and ends at 504. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [493.0] and does not return any value. It declares 6.0 f... |
VectorInstitute_vector-inference | TestListCmdDisplay | public | 0 | 0 | test_display_all_models_output_table | def test_display_all_models_output_table(self):"""Test displaying all models output in table mode."""console = Console()display = ListCmdDisplay(console, json_mode=False)model_info = MagicMock(spec=ModelInfo)model_info.name = "test-model"model_info.family = "test-family"model_info.model_type = "LLM"model_info.variant =... | 1 | 12 | 1 | 77 | 0 | 506 | 521 | 506 | self | [] | None | {"Assign": 8, "Expr": 3, "With": 1} | 6 | 16 | 6 | ["Console", "ListCmdDisplay", "MagicMock", "patch.object", "display.display_all_models_output", "mock_print.assert_called_once"] | 0 | [] | The function (test_display_all_models_output_table) defined within the public class called TestListCmdDisplay.The function start at line 506 and ends at 521. It contains 12 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 6.0 fun... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_create_table_with_header | def test_create_table_with_header():"""Test that create_table creates a table with the correct header."""table = create_table("Key", "Value")assert table.columns[0].header == "Key"assert table.columns[1].header == "Value"assert table.show_header is True | 1 | 5 | 0 | 41 | 1 | 6 | 11 | 6 | ['table'] | None | {"Assign": 1, "Expr": 1} | 1 | 6 | 1 | ["create_table"] | 0 | [] | The function (test_create_table_with_header) defined within the public class called public.The function start at line 6 and ends at 11. 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 declare 1.0 function, and It has 1.0 f... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_create_table_without_header | def test_create_table_without_header():"""Test create_table without header."""table = create_table(show_header=False)assert table.show_header is False | 1 | 3 | 0 | 19 | 1 | 14 | 17 | 14 | ['table'] | None | {"Assign": 1, "Expr": 1} | 1 | 4 | 1 | ["create_table"] | 0 | [] | The function (test_create_table_without_header) defined within the public class called public.The function start at line 14 and ends at 17. 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... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | mock_model_config | def mock_model_config():"""Return a mock model configuration."""return {"model_family": "test-family","model_variant": "test-variant","model_type": "LLM","num_gpus": 1,"num_nodes": 1,} | 1 | 8 | 0 | 28 | 0 | 16 | 24 | 16 | [] | Returns | {"Expr": 1, "Return": 1} | 0 | 9 | 0 | [] | 0 | [] | The function (mock_model_config) defined within the public class called public.The function start at line 16 and ends at 24. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. | |
VectorInstitute_vector-inference | public | public | 0 | 0 | mock_launch_output | def mock_launch_output():"""Fixture providing mock launch output."""return """Submitted batch job 12345678""".strip() | 1 | 4 | 0 | 11 | 0 | 28 | 32 | 28 | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 5 | 1 | ["strip"] | 0 | [] | The function (mock_launch_output) defined within the public class called public.The function start at line 28 and ends at 32. 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 declare 1.0 function, and It has 1.0 functio... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | mock_status_output | def mock_status_output():"""Fixture providing mock status output."""return """JobId=12345678 JobName=test-model JobState=READY""".strip() | 1 | 4 | 0 | 11 | 0 | 36 | 40 | 36 | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 5 | 1 | ["strip"] | 0 | [] | The function (mock_status_output) defined within the public class called public.The function start at line 36 and ends at 40. 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 declare 1.0 function, and It has 1.0 functio... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_list_models | def test_list_models():"""Test that list_models returns model information."""# Create a mock model with specific attributes instead of relying on MagicMockmock_model = MagicMock()mock_model.name = "test-model"mock_model.family = "test-family"mock_model.variant = "test-variant"mock_model.type = ModelType.LLMclient = Vec... | 1 | 13 | 0 | 89 | 3 | 43 | 64 | 43 | ['mock_model', 'models', 'client'] | None | {"Assign": 8, "Expr": 1} | 4 | 22 | 4 | ["MagicMock", "VecInfClient", "client.list_models", "len"] | 0 | [] | The function (test_list_models) defined within the public class called public.The function start at line 43 and ends at 64. It contains 13 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 has 4.0 functions ... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_launch_model | def test_launch_model(mock_model_config, mock_launch_output):"""Test successfully launching a model."""client = VecInfClient()# Create mocks for all the dependenciesclient.get_model_config = MagicMock(return_value=MagicMock())with (patch("vec_inf.client._utils.run_bash_command",return_value=(mock_launch_output, ""),),p... | 1 | 19 | 2 | 104 | 3 | 67 | 94 | 67 | mock_model_config,mock_launch_output | ['client', 'result', 'response'] | None | {"Assign": 7, "Expr": 1, "With": 1} | 7 | 28 | 7 | ["VecInfClient", "MagicMock", "MagicMock", "patch", "patch", "MagicMock", "client.launch_model"] | 0 | [] | The function (test_launch_model) defined within the public class called public.The function start at line 67 and ends at 94. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [67.0] and does not return any value. It declares 7.0 functions, and It has 7.0 functi... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_get_status | def test_get_status(mock_status_output):"""Test getting the status of a model."""client = VecInfClient()# Create a mock for the status responsestatus_response = MagicMock()status_response.slurm_job_id = "12345678"status_response.status = ModelStatus.READY# Mock the get_status methodclient.get_status = lambda job_id, lo... | 1 | 9 | 1 | 62 | 3 | 97 | 113 | 97 | mock_status_output | ['status_response', 'client', 'status'] | None | {"Assign": 6, "Expr": 1} | 3 | 17 | 3 | ["VecInfClient", "MagicMock", "client.get_status"] | 0 | [] | The function (test_get_status) defined within the public class called public.The function start at line 97 and ends at 113. 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 3.0 functions, and It has 3.0 functions c... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_wait_until_ready | def test_wait_until_ready():"""Test waiting for a model to be ready."""with patch.object(VecInfClient, "get_status") as mock_status:# First call returns LAUNCHING, second call returns READYstatus1 = MagicMock()status1.server_status = ModelStatus.LAUNCHINGstatus2 = MagicMock()status2.server_status = ModelStatus.READYsta... | 1 | 14 | 0 | 98 | 4 | 116 | 135 | 116 | ['status1', 'result', 'client', 'status2'] | None | {"Assign": 8, "Expr": 1, "With": 2} | 6 | 20 | 6 | ["patch.object", "MagicMock", "MagicMock", "patch", "VecInfClient", "client.wait_until_ready"] | 0 | [] | The function (test_wait_until_ready) defined within the public class called public.The function start at line 116 and ends at 135. It contains 14 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 6.0 functions, and It has 6.0 fun... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_cleanup_logs_no_match | def test_cleanup_logs_no_match(tmp_path):"""Test when cleanup_logs returns empty list."""fam_a = tmp_path / "fam_a"model_a = fam_a / "model_a.999"model_a.mkdir(parents=True)client = VecInfClient()deleted = client.cleanup_logs(log_dir=tmp_path,model_family="fam_b",dry_run=False,)assert deleted == []assert fam_a.exists()... | 1 | 13 | 1 | 65 | 4 | 138 | 153 | 138 | tmp_path | ['deleted', 'client', 'model_a', 'fam_a'] | None | {"Assign": 4, "Expr": 2} | 5 | 16 | 5 | ["model_a.mkdir", "VecInfClient", "client.cleanup_logs", "fam_a.exists", "model_a.exists"] | 0 | [] | The function (test_cleanup_logs_no_match) defined within the public class called public.The function start at line 138 and ends at 153. It contains 13 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.... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_cleanup_logs_deletes_matching_dirs | def test_cleanup_logs_deletes_matching_dirs(tmp_path):"""Test that cleanup_logs deletes model directories matching filters."""fam_a = tmp_path / "fam_a"fam_a.mkdir()model_a_1 = fam_a / "model_a.10"model_a_2 = fam_a / "model_a.20"model_b = fam_a / "model_b.30"model_a_1.mkdir()model_a_2.mkdir()model_b.mkdir()client = Vec... | 1 | 21 | 1 | 103 | 6 | 156 | 181 | 156 | tmp_path | ['client', 'model_a_1', 'fam_a', 'model_a_2', 'deleted', 'model_b'] | None | {"Assign": 6, "Expr": 5} | 9 | 26 | 9 | ["fam_a.mkdir", "model_a_1.mkdir", "model_a_2.mkdir", "model_b.mkdir", "VecInfClient", "client.cleanup_logs", "model_a_1.exists", "model_a_2.exists", "model_b.exists"] | 0 | [] | The function (test_cleanup_logs_deletes_matching_dirs) defined within the public class called public.The function start at line 156 and ends at 181. It contains 21 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 functions, a... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_cleanup_logs_matching_dirs_dry_run | def test_cleanup_logs_matching_dirs_dry_run(tmp_path):"""Test that cleanup_logs find model directories matching filters."""fam_a = tmp_path / "fam_a"fam_a.mkdir()model_a_1 = fam_a / "model_a.10"model_a_2 = fam_a / "model_a.20"model_a_1.mkdir()model_a_2.mkdir()client = VecInfClient()deleted = client.cleanup_logs(log_dir... | 1 | 18 | 1 | 86 | 5 | 184 | 206 | 184 | tmp_path | ['client', 'model_a_1', 'fam_a', 'model_a_2', 'deleted'] | None | {"Assign": 5, "Expr": 4} | 7 | 23 | 7 | ["fam_a.mkdir", "model_a_1.mkdir", "model_a_2.mkdir", "VecInfClient", "client.cleanup_logs", "model_a_1.exists", "model_a_2.exists"] | 0 | [] | The function (test_cleanup_logs_matching_dirs_dry_run) defined within the public class called public.The function start at line 184 and ends at 206. 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 declares 7.0 functions, a... |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_shutdown_model_success | def test_shutdown_model_success():"""Test model shutdown success."""client = VecInfClient()with patch("vec_inf.client.api.run_bash_command") as mock_command:mock_command.return_value = ("", "")result = client.shutdown_model(12345)assert result is Truemock_command.assert_called_once_with("scancel 12345") | 1 | 7 | 0 | 45 | 2 | 209 | 217 | 209 | ['client', 'result'] | None | {"Assign": 3, "Expr": 2, "With": 1} | 4 | 9 | 4 | ["VecInfClient", "patch", "client.shutdown_model", "mock_command.assert_called_once_with"] | 0 | [] | The function (test_shutdown_model_success) defined within the public class called public.The function start at line 209 and ends at 217. 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, and It has 4.... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_shutdown_model_failure | def test_shutdown_model_failure():"""Test model shutdown failure."""client = VecInfClient()with patch("vec_inf.client.api.run_bash_command") as mock_command:mock_command.return_value = ("", "Error: Job not found")with pytest.raises(SlurmJobError, match="Failed to shutdown model: Error: Job not found"):client.shutdown_m... | 1 | 8 | 0 | 45 | 1 | 220 | 228 | 220 | ['client'] | None | {"Assign": 2, "Expr": 2, "With": 2} | 4 | 9 | 4 | ["VecInfClient", "patch", "pytest.raises", "client.shutdown_model"] | 0 | [] | The function (test_shutdown_model_failure) defined within the public class called public.The function start at line 220 and ends at 228. 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 4.0 functions, and It has 4.... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_wait_until_ready_timeout | def test_wait_until_ready_timeout():"""Test timeout in wait_until_ready."""client = VecInfClient()with patch.object(client, "get_status") as mock_status:mock_response = MagicMock()mock_response.server_status = ModelStatus.LAUNCHINGmock_status.return_value = mock_responsewith (patch("time.sleep"),pytest.raises(ServerErr... | 1 | 11 | 0 | 75 | 2 | 231 | 244 | 231 | ['client', 'mock_response'] | None | {"Assign": 4, "Expr": 2, "With": 2} | 6 | 14 | 6 | ["VecInfClient", "patch.object", "MagicMock", "patch", "pytest.raises", "client.wait_until_ready"] | 0 | [] | The function (test_wait_until_ready_timeout) defined within the public class called public.The function start at line 231 and ends at 244. 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. It declares 6.0 functions, and It has... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_wait_until_ready_failed_status | def test_wait_until_ready_failed_status():"""Test wait_until_ready when model fails."""client = VecInfClient()with patch.object(client, "get_status") as mock_status:mock_response = MagicMock()mock_response.server_status = ModelStatus.FAILEDmock_response.failed_reason = "Out of memory"mock_status.return_value = mock_res... | 1 | 9 | 0 | 62 | 2 | 247 | 258 | 247 | ['client', 'mock_response'] | None | {"Assign": 5, "Expr": 2, "With": 2} | 5 | 12 | 5 | ["VecInfClient", "patch.object", "MagicMock", "pytest.raises", "client.wait_until_ready"] | 0 | [] | The function (test_wait_until_ready_failed_status) defined within the public class called public.The function start at line 247 and ends at 258. 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 I... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_wait_until_ready_failed_no_reason | def test_wait_until_ready_failed_no_reason():"""Test wait_until_ready when model fails without reason."""client = VecInfClient()with patch.object(client, "get_status") as mock_status:mock_response = MagicMock()mock_response.server_status = ModelStatus.FAILEDmock_response.failed_reason = Nonemock_status.return_value = m... | 1 | 9 | 0 | 62 | 2 | 261 | 272 | 261 | ['client', 'mock_response'] | None | {"Assign": 5, "Expr": 2, "With": 2} | 5 | 12 | 5 | ["VecInfClient", "patch.object", "MagicMock", "pytest.raises", "client.wait_until_ready"] | 0 | [] | The function (test_wait_until_ready_failed_no_reason) defined within the public class called public.The function start at line 261 and ends at 272. 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... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_wait_until_ready_shutdown | def test_wait_until_ready_shutdown():"""Test wait_until_ready when model is shutdown."""client = VecInfClient()with patch.object(client, "get_status") as mock_status:mock_response = MagicMock()mock_response.server_status = ModelStatus.SHUTDOWNmock_status.return_value = mock_responsewith pytest.raises(ServerError, match... | 1 | 10 | 0 | 57 | 2 | 275 | 287 | 275 | ['client', 'mock_response'] | None | {"Assign": 4, "Expr": 2, "With": 2} | 5 | 13 | 5 | ["VecInfClient", "patch.object", "MagicMock", "pytest.raises", "client.wait_until_ready"] | 0 | [] | The function (test_wait_until_ready_shutdown) defined within the public class called public.The function start at line 275 and ends at 287. 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 functions, and It ha... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_success | def test_batch_launch_models_success():"""Test successfully launching multiple models in batch mode."""client = VecInfClient()# Create a mock batch responsemock_response = MagicMock()mock_response.slurm_job_id = "12345678"mock_response.slurm_job_name = "BATCH-model1-model2"mock_response.model_names = ["model1", "model2... | 1 | 13 | 0 | 98 | 3 | 290 | 309 | 290 | ['client', 'result', 'mock_response'] | None | {"Assign": 8, "Expr": 1} | 3 | 20 | 3 | ["VecInfClient", "MagicMock", "client.batch_launch_models"] | 0 | [] | The function (test_batch_launch_models_success) defined within the public class called public.The function start at line 290 and ends at 309. It contains 13 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 ... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_with_config | def test_batch_launch_models_with_config():"""Test launching multiple models with custom batch configuration."""client = VecInfClient()# Create a mock batch responsemock_response = MagicMock()mock_response.slurm_job_id = "12345678"mock_response.slurm_job_name = "BATCH-model1-model2"mock_response.model_names = ["model1"... | 1 | 14 | 0 | 93 | 3 | 312 | 332 | 312 | ['client', 'result', 'mock_response'] | None | {"Assign": 8, "Expr": 1} | 3 | 21 | 3 | ["VecInfClient", "MagicMock", "client.batch_launch_models"] | 0 | [] | The function (test_batch_launch_models_with_config) defined within the public class called public.The function start at line 312 and ends at 332. It contains 14 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 ... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_empty_list.mock_batch_launch | def mock_batch_launch(model_names, batch_config=None):if not model_names:raise ValueError("Model names list cannot be empty")return MagicMock() | 2 | 4 | 2 | 22 | 0 | 340 | 343 | 340 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_batch_launch_models_empty_list.mock_batch_launch) defined within the public class called public.The function start at line 340 and ends at 343. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [340.0] and does not return any value.. |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_empty_list | def test_batch_launch_models_empty_list():"""Test that batch launch with empty model list raises an error."""client = VecInfClient()# Mock the batch launch method to raise an error for empty listdef mock_batch_launch(model_names, batch_config=None):if not model_names:raise ValueError("Model names list cannot be empty")... | 1 | 6 | 0 | 36 | 1 | 335 | 348 | 335 | ['client'] | Returns | {"Assign": 2, "Expr": 2, "If": 1, "Return": 1, "With": 1} | 5 | 14 | 5 | ["VecInfClient", "ValueError", "MagicMock", "pytest.raises", "client.batch_launch_models"] | 0 | [] | The function (test_batch_launch_models_empty_list) defined within the public class called public.The function start at line 335 and ends at 348. It contains 6 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 5.0 functions, an... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_single_model | def test_batch_launch_models_single_model():"""Test launching a single model in batch mode."""client = VecInfClient()# Create a mock batch response for single modelmock_response = MagicMock()mock_response.slurm_job_id = "12345678"mock_response.slurm_job_name = "BATCH-model1"mock_response.model_names = ["model1"]mock_re... | 1 | 13 | 0 | 92 | 3 | 351 | 370 | 351 | ['client', 'result', 'mock_response'] | None | {"Assign": 8, "Expr": 1} | 4 | 20 | 4 | ["VecInfClient", "MagicMock", "client.batch_launch_models", "len"] | 0 | [] | The function (test_batch_launch_models_single_model) defined within the public class called public.The function start at line 351 and ends at 370. It contains 13 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... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_three_models | def test_batch_launch_models_three_models():"""Test launching three models in batch mode."""client = VecInfClient()# Create a mock batch response for three modelsmock_response = MagicMock()mock_response.slurm_job_id = "12345678"mock_response.slurm_job_name = "BATCH-model1-model2-model3"mock_response.model_names = ["mod... | 1 | 13 | 0 | 104 | 3 | 373 | 392 | 373 | ['client', 'result', 'mock_response'] | None | {"Assign": 8, "Expr": 1} | 4 | 20 | 4 | ["VecInfClient", "MagicMock", "client.batch_launch_models", "len"] | 0 | [] | The function (test_batch_launch_models_three_models) defined within the public class called public.The function start at line 373 and ends at 392. It contains 13 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... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_with_special_characters | def test_batch_launch_models_with_special_characters():"""Test launching models with special characters in names."""client = VecInfClient()# Create a mock batch response for models with special charactersmock_response = MagicMock()mock_response.slurm_job_id = "12345678"mock_response.slurm_job_name = "BATCH-model-1-mode... | 1 | 12 | 0 | 89 | 3 | 395 | 413 | 395 | ['client', 'result', 'mock_response'] | None | {"Assign": 8, "Expr": 1} | 3 | 19 | 3 | ["VecInfClient", "MagicMock", "client.batch_launch_models"] | 0 | [] | The function (test_batch_launch_models_with_special_characters) defined within the public class called public.The function start at line 395 and ends at 413. It contains 12 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 fun... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_configuration_error.mock_batch_launch | def mock_batch_launch(model_names, batch_config=None):raise ModelConfigurationError("Model 'nonexistent-model' not found in configuration") | 1 | 4 | 2 | 14 | 0 | 421 | 424 | 421 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_batch_launch_models_configuration_error.mock_batch_launch) defined within the public class called public.The function start at line 421 and ends at 424. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [421.0] and does not return any value.. |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_configuration_error | def test_batch_launch_models_configuration_error():"""Test that batch launch raises configuration error when models are not found."""client = VecInfClient()# Mock the batch launch method to raise a configuration errordef mock_batch_launch(model_names, batch_config=None):raise ModelConfigurationError("Model 'nonexistent... | 1 | 9 | 0 | 40 | 1 | 416 | 432 | 416 | ['client'] | None | {"Assign": 2, "Expr": 2, "With": 1} | 4 | 17 | 4 | ["VecInfClient", "ModelConfigurationError", "pytest.raises", "client.batch_launch_models"] | 0 | [] | The function (test_batch_launch_models_configuration_error) defined within the public class called public.The function start at line 416 and ends at 432. 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 4.0 function... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_slurm_error.mock_batch_launch | def mock_batch_launch(model_names, batch_config=None):raise SlurmJobError("sbatch: error: Invalid partition specified") | 1 | 2 | 2 | 14 | 0 | 440 | 441 | 440 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_batch_launch_models_slurm_error.mock_batch_launch) defined within the public class called public.The function start at line 440 and ends at 441. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [440.0] and does not return any value.. |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_slurm_error | def test_batch_launch_models_slurm_error():"""Test that batch launch raises SLURM error when job submission fails."""client = VecInfClient()# Mock the batch launch method to raise a SLURM errordef mock_batch_launch(model_names, batch_config=None):raise SlurmJobError("sbatch: error: Invalid partition specified")client.b... | 1 | 8 | 0 | 39 | 1 | 435 | 448 | 435 | ['client'] | None | {"Assign": 2, "Expr": 2, "With": 1} | 4 | 14 | 4 | ["VecInfClient", "SlurmJobError", "pytest.raises", "client.batch_launch_models"] | 0 | [] | The function (test_batch_launch_models_slurm_error) defined within the public class called public.The function start at line 435 and ends at 448. 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 4.0 functions, and ... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_integration | def test_batch_launch_models_integration():"""Test integration of batch launch with actual BatchModelLauncher."""client = VecInfClient()with (patch("vec_inf.client.api.BatchModelLauncher") as mock_launcher_class,patch("vec_inf.client.api.run_bash_command",return_value=("Submitted batch job 12345678", ""),),):# Mock the... | 1 | 25 | 0 | 135 | 3 | 451 | 483 | 451 | ['client', 'result', 'mock_launcher'] | None | {"Assign": 5, "Expr": 3, "With": 1} | 8 | 33 | 8 | ["VecInfClient", "patch", "patch", "MagicMock", "MagicMock", "client.batch_launch_models", "mock_launcher_class.assert_called_once_with", "mock_launcher.launch.assert_called_once"] | 0 | [] | The function (test_batch_launch_models_integration) defined within the public class called public.The function start at line 451 and ends at 483. It contains 25 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 ... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_batch_launch_models_with_custom_config_integration | def test_batch_launch_models_with_custom_config_integration():"""Test integration of batch launch with custom configuration."""client = VecInfClient()with (patch("vec_inf.client.api.BatchModelLauncher") as mock_launcher_class,patch("vec_inf.client.api.run_bash_command",return_value=("Submitted batch job 12345678", ""),... | 1 | 27 | 0 | 139 | 3 | 486 | 520 | 486 | ['client', 'result', 'mock_launcher'] | None | {"Assign": 5, "Expr": 3, "With": 1} | 8 | 35 | 8 | ["VecInfClient", "patch", "patch", "MagicMock", "MagicMock", "client.batch_launch_models", "mock_launcher_class.assert_called_once_with", "mock_launcher.launch.assert_called_once"] | 0 | [] | The function (test_batch_launch_models_with_custom_config_integration) defined within the public class called public.The function start at line 486 and ends at 520. It contains 27 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 ... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | mock_client | def mock_client():"""Create a mocked VecInfClient."""client = MagicMock(spec=VecInfClient)# Set up mock responsesmock_model1 = MagicMock()mock_model1.name = "test-model"mock_model1.family = "test-family"mock_model1.type = ModelType.LLMmock_model2 = MagicMock()mock_model2.name = "test-model-2"mock_model2.family = "test-... | 1 | 23 | 0 | 137 | 6 | 12 | 43 | 12 | ['launch_response', 'client', 'metrics_response', 'mock_model1', 'status_response', 'mock_model2'] | Returns | {"Assign": 21, "Expr": 1, "Return": 1} | 6 | 32 | 6 | ["MagicMock", "MagicMock", "MagicMock", "MagicMock", "MagicMock", "MagicMock"] | 9 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556628_apache_airflow.providers.amazon.tests.unit.amazon.aws.secrets.test_secrets_manager_py.TestSecretsManagerBackend.test_config_lookup_pattern", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94556628_apache_air... | The function (mock_client) defined within the public class called public.The function start at line 12 and ends at 43. It contains 23 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, It has 6.0 functions called... | |
VectorInstitute_vector-inference | public | public | 0 | 0 | test_api_usage_example | def test_api_usage_example():"""Test the basic API usage example."""example_path = (Path(__file__).parent.parent.parent.parent/ "examples"/ "api"/ "basic_usage.py")# Create a mock clientmock_client = MagicMock(spec=VecInfClient)# Set up mock responsesmock_model = MagicMock()mock_model.name = "Meta-Llama-3.1-8B-Instruct... | 1 | 33 | 0 | 192 | 6 | 55 | 99 | 55 | ['launch_response', 'metrics_response', 'status_response', 'mock_client', 'example_path', 'mock_model'] | None | {"Assign": 16, "Expr": 7, "With": 1} | 19 | 45 | 19 | ["Path", "MagicMock", "MagicMock", "MagicMock", "MagicMock", "MagicMock", "patch", "patch", "example_path.open", "exec", "f.read", "mock_client.list_models.assert_called_once", "mock_client.launch_model.assert_called_once", "mock_client.wait_until_ready.assert_called_once", "mock_client.get_metrics.assert_called_once",... | 0 | [] | The function (test_api_usage_example) defined within the public class called public.The function start at line 55 and ends at 99. It contains 33 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 19.0 functions, and It has 19.0 fu... | |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | model_config | def model_config(self) -> ModelConfig:"""Fixture providing a basic model configuration for tests."""return ModelConfig(model_name="test-model",model_family="test-family",model_type="LLM",gpus_per_node=1,num_nodes=1,vocab_size=32000,model_weights_parent_dir=Path("/path/to/models"),resource_type="l40s",partition="gpu",qo... | 1 | 19 | 1 | 80 | 0 | 36 | 55 | 36 | self | [] | ModelConfig | {"Expr": 1, "Return": 1} | 2 | 20 | 2 | ["ModelConfig", "Path"] | 0 | [] | The function (model_config) defined within the public class called TestModelLauncher.The function start at line 36 and ends at 55. It contains 19 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 It has 2.0 fun... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | mock_configs | def mock_configs(self, model_config):"""Fixture providing a list of model configurations."""return [model_config] | 1 | 2 | 2 | 12 | 0 | 58 | 60 | 58 | self,model_config | [] | Returns | {"Expr": 1, "Return": 1} | 0 | 3 | 0 | [] | 0 | [] | The function (mock_configs) defined within the public class called TestModelLauncher.The function start at line 58 and ends at 60. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [58.0], and this function return a value.. |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_init_with_existing_config | def test_init_with_existing_config(self, mock_load_config, mock_configs):"""Test launcher initializes correctly when config exists."""mock_load_config.return_value = mock_configslauncher = ModelLauncher("test-model", {})assert launcher.model_name == "test-model"assert launcher.model_config.model_name == "test-model"ass... | 1 | 6 | 3 | 46 | 0 | 63 | 70 | 63 | self,mock_load_config,mock_configs | [] | None | {"Assign": 2, "Expr": 1} | 2 | 8 | 2 | ["ModelLauncher", "patch"] | 0 | [] | The function (test_init_with_existing_config) defined within the public class called TestModelLauncher.The function start at line 63 and ends at 70. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [63.0] and does not return any value. It declares 2.0 functions,... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_init_with_missing_config_and_existing_weights | def test_init_with_missing_config_and_existing_weights(self, mock_path_exists, mock_load_config, mock_configs):"""Test fallback to dummy config when config is missing but weights exist."""mock_load_config.return_value = mock_configsmock_path_exists.return_value = Truewith pytest.warns(UserWarning):launcher = ModelLaunc... | 1 | 13 | 4 | 69 | 0 | 74 | 89 | 74 | self,mock_path_exists,mock_load_config,mock_configs | [] | None | {"Assign": 3, "Expr": 1, "With": 1} | 4 | 16 | 4 | ["pytest.warns", "ModelLauncher", "patch", "patch"] | 0 | [] | The function (test_init_with_missing_config_and_existing_weights) defined within the public class called TestModelLauncher.The function start at line 74 and ends at 89. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [74.0] and does not return any value. It de... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_init_with_missing_config_and_missing_weights | def test_init_with_missing_config_and_missing_weights(self, mock_path_exists, mock_load_config, mock_configs):"""Test error is raised when both config and weights are missing."""mock_load_config.return_value = mock_configsmock_path_exists.return_value = Falsewith pytest.raises(ModelConfigurationError):ModelLauncher("un... | 1 | 7 | 4 | 37 | 0 | 93 | 101 | 93 | self,mock_path_exists,mock_load_config,mock_configs | [] | None | {"Assign": 2, "Expr": 2, "With": 1} | 4 | 9 | 4 | ["pytest.raises", "ModelLauncher", "patch", "patch"] | 0 | [] | The function (test_init_with_missing_config_and_missing_weights) defined within the public class called TestModelLauncher.The function start at line 93 and ends at 101. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [93.0] and does not return any value. It dec... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_init_with_empty_configs | def test_init_with_empty_configs(self, mock_load_config):"""Test error is raised when config list is empty."""mock_load_config.return_value = []with pytest.raises(ModelNotFoundError):ModelLauncher("test-model", {}) | 1 | 4 | 2 | 29 | 0 | 104 | 109 | 104 | self,mock_load_config | [] | None | {"Assign": 1, "Expr": 2, "With": 1} | 3 | 6 | 3 | ["pytest.raises", "ModelLauncher", "patch"] | 0 | [] | The function (test_init_with_empty_configs) defined within the public class called TestModelLauncher.The function start at line 104 and ends at 109. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [104.0] and does not return any value. It declares 3.0 functions... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_process_vllm_args | def test_process_vllm_args(self, mock_path_exists, mock_load_config, mock_configs):"""Test vLLM args are parsed correctly into key-value pairs."""mock_load_config.return_value = mock_configsmock_path_exists.return_value = Truelauncher = ModelLauncher("test-model", {})vllm_args = launcher._process_vllm_args("--tensor-pa... | 1 | 10 | 4 | 60 | 0 | 113 | 125 | 113 | self,mock_path_exists,mock_load_config,mock_configs | [] | None | {"Assign": 4, "Expr": 1} | 4 | 13 | 4 | ["ModelLauncher", "launcher._process_vllm_args", "patch", "patch"] | 0 | [] | The function (test_process_vllm_args) defined within the public class called TestModelLauncher.The function start at line 113 and ends at 125. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [113.0] and does not return any value. It declares 4.0 functions, and... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_process_env_vars | def test_process_env_vars(self, mock_path_exists, mock_load_config, mock_configs):"""Test that vars from `--env` flag are parsed correctly."""mock_load_config.return_value = mock_configsmock_path_exists.return_value = True# Get filepath of dummy env filefile_path = Path(__file__).parent / "test_vars.env"launcher = Mode... | 1 | 9 | 4 | 71 | 0 | 129 | 141 | 129 | self,mock_path_exists,mock_load_config,mock_configs | [] | None | {"Assign": 5, "Expr": 1} | 5 | 13 | 5 | ["Path", "ModelLauncher", "launcher._process_env_vars", "patch", "patch"] | 0 | [] | The function (test_process_env_vars) defined within the public class called TestModelLauncher.The function start at line 129 and ends at 141. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [129.0] and does not return any value. It declares 5.0 functions, and ... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_get_launch_params_merges_config_and_cli_args | def test_get_launch_params_merges_config_and_cli_args(self, mock_load_config, model_config):"""Test _get_launch_params merges config and CLI vllm_args correctly."""mock_load_config.return_value = [model_config]cli_kwargs = {"vllm_args": "--num-scheduler-steps=16, -pp=4", "num_nodes": 4}launcher = ModelLauncher("test-mo... | 1 | 9 | 3 | 58 | 0 | 144 | 155 | 144 | self,mock_load_config,model_config | [] | None | {"Assign": 4, "Expr": 1} | 2 | 12 | 2 | ["ModelLauncher", "patch"] | 0 | [] | The function (test_get_launch_params_merges_config_and_cli_args) defined within the public class called TestModelLauncher.The function start at line 144 and ends at 155. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [144.0] and does not return any value. It d... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_get_launch_params_with_multi_gpu_no_tp | def test_get_launch_params_with_multi_gpu_no_tp(self, mock_load_config, model_config):"""Test the case tensor parallelism is missing in multi-GPU setup."""updated_config = model_config.model_copy(update={"gpus_per_node": 2,})mock_load_config.return_value = [updated_config]with pytest.raises(MissingRequiredFieldsError) ... | 1 | 12 | 3 | 58 | 0 | 158 | 172 | 158 | self,mock_load_config,model_config | [] | None | {"Assign": 2, "Expr": 2, "With": 1} | 5 | 15 | 5 | ["model_config.model_copy", "pytest.raises", "ModelLauncher", "str", "patch"] | 0 | [] | The function (test_get_launch_params_with_multi_gpu_no_tp) defined within the public class called TestModelLauncher.The function start at line 158 and ends at 172. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [158.0] and does not return any value. It declar... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_launch | def test_launch(self,mock_rename,mock_open,mock_touch,mock_mkdir,mock_script_gen,mock_run_bash,mock_load_config,mock_configs,):"""Test successful model launch returns expected response and creates logs."""mock_open.return_value = mock.mock_open().return_valuemock_load_config.return_value = mock_configsmock_script_gen_i... | 1 | 28 | 9 | 126 | 0 | 181 | 212 | 181 | self,mock_rename,mock_open,mock_touch,mock_mkdir,mock_script_gen,mock_run_bash,mock_load_config,mock_configs | [] | None | {"Assign": 8, "Expr": 4} | 15 | 32 | 15 | ["mock.mock_open", "MagicMock", "Path", "ModelLauncher", "launcher.launch", "mock_mkdir.assert_called", "mock_touch.assert_called", "mock_rename.assert_called", "patch", "patch", "patch", "patch", "patch", "patch", "patch"] | 0 | [] | The function (test_launch) defined within the public class called TestModelLauncher.The function start at line 181 and ends at 212. It contains 28 lines of code and it has a cyclomatic complexity of 1. It takes 9 parameters, represented as [181.0] and does not return any value. It declares 15.0 functions, and It has 1... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_launch_with_slurm_error | def test_launch_with_slurm_error(self, mock_run_bash, mock_load_config, model_config):"""Test launch raises error on SLURM submission failure."""mock_load_config.return_value = [model_config]mock_run_bash.return_value = ("", "sbatch: error: Invalid partition specified")launcher = ModelLauncher("test-model", {})with pyt... | 1 | 8 | 4 | 50 | 0 | 216 | 225 | 216 | self,mock_run_bash,mock_load_config,model_config | [] | None | {"Assign": 3, "Expr": 2, "With": 1} | 5 | 10 | 5 | ["ModelLauncher", "pytest.raises", "launcher.launch", "patch", "patch"] | 0 | [] | The function (test_launch_with_slurm_error) defined within the public class called TestModelLauncher.The function start at line 216 and ends at 225. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [216.0] and does not return any value. It declares 5.0 functions... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | batch_model_configs | def batch_model_configs(self) -> list[ModelConfig]:"""Fixture providing batch model configurations for tests."""return [ModelConfig(model_name="family1-variant1",model_family="family1",model_variant="variant1",model_type="LLM",gpus_per_node=1,num_nodes=1,vocab_size=32000,model_weights_parent_dir=Path("/path/to/models")... | 1 | 60 | 1 | 242 | 0 | 232 | 292 | 232 | self | [] | list[ModelConfig] | {"Expr": 1, "Return": 1} | 6 | 61 | 6 | ["ModelConfig", "Path", "ModelConfig", "Path", "ModelConfig", "Path"] | 0 | [] | The function (batch_model_configs) defined within the public class called TestBatchModelLauncher.The function start at line 232 and ends at 292. It contains 60 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 6.0 functions, and ... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_init_with_valid_configs | def test_init_with_valid_configs(self, mock_load_config, batch_model_configs):"""Test launcher initializes correctly with valid model configurations."""mock_load_config.return_value = batch_model_configslauncher = BatchModelLauncher(["family1-variant1", "family2-variant1"],account="test-account",work_dir="/tmp/test-wor... | 1 | 12 | 3 | 71 | 0 | 295 | 308 | 295 | self,mock_load_config,batch_model_configs | [] | None | {"Assign": 2, "Expr": 1} | 3 | 14 | 3 | ["BatchModelLauncher", "len", "patch"] | 0 | [] | The function (test_init_with_valid_configs) defined within the public class called TestBatchModelLauncher.The function start at line 295 and ends at 308. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [295.0] and does not return any value. It declares 3.0 fun... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_init_with_missing_model_config | def test_init_with_missing_model_config(self, mock_load_config, batch_model_configs):"""Test error is raised when one of the models is missing from config."""mock_load_config.return_value = batch_model_configswith pytest.raises(ModelConfigurationError) as excinfo:BatchModelLauncher(["family1-variant1", "nonexistent-mod... | 1 | 8 | 3 | 51 | 0 | 311 | 321 | 311 | self,mock_load_config,batch_model_configs | [] | None | {"Assign": 1, "Expr": 2, "With": 1} | 5 | 11 | 5 | ["pytest.raises", "BatchModelLauncher", "str", "str", "patch"] | 0 | [] | The function (test_init_with_missing_model_config) defined within the public class called TestBatchModelLauncher.The function start at line 311 and ends at 321. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [311.0] and does not return any value. It declares 5... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_get_slurm_job_name | def test_get_slurm_job_name(self, mock_load_config, batch_model_configs):"""Test SLURM job name is constructed correctly from model names."""mock_load_config.return_value = batch_model_configslauncher = BatchModelLauncher(["family1-variant1", "family2-variant1", "family1-variant2"],account="test-account",work_dir="/tmp... | 1 | 11 | 3 | 44 | 0 | 324 | 336 | 324 | self,mock_load_config,batch_model_configs | [] | None | {"Assign": 2, "Expr": 1} | 2 | 13 | 2 | ["BatchModelLauncher", "patch"] | 0 | [] | The function (test_get_slurm_job_name) defined within the public class called TestBatchModelLauncher.The function start at line 324 and ends at 336. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [324.0] and does not return any value. It declares 2.0 function... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_get_launch_params_creates_log_dirs | def test_get_launch_params_creates_log_dirs(self, mock_mkdir, mock_load_config, batch_model_configs):"""Test launch parameters preparation creates log directories."""mock_load_config.return_value = batch_model_configslauncher = BatchModelLauncher(["family1-variant1", "family2-variant1", "family1-variant2"],account="tes... | 1 | 20 | 4 | 92 | 0 | 340 | 364 | 340 | self,mock_mkdir,mock_load_config,batch_model_configs | [] | None | {"Assign": 3, "Expr": 2} | 5 | 25 | 5 | ["BatchModelLauncher", "str", "mock_mkdir.assert_called", "patch", "patch"] | 0 | [] | The function (test_get_launch_params_creates_log_dirs) defined within the public class called TestBatchModelLauncher.The function start at line 340 and ends at 364. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [340.0] and does not return any value. It decla... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_get_launch_params_with_multi_gpu_no_tp | def test_get_launch_params_with_multi_gpu_no_tp(self, mock_load_config, batch_model_configs):"""Test error when tensor parallelism is missing in multi-GPU setup."""updated_configs = [batch_model_configs[0].model_copy(update={"gpus_per_node": 2}),batch_model_configs[1],]mock_load_config.return_value = updated_configswit... | 1 | 16 | 3 | 85 | 0 | 367 | 385 | 367 | self,mock_load_config,model_config | [] | None | {"Assign": 2, "Expr": 2, "With": 1} | 5 | 15 | 5 | ["model_config.model_copy", "pytest.raises", "ModelLauncher", "str", "patch"] | 0 | [] | The function (test_get_launch_params_with_multi_gpu_no_tp) defined within the public class called TestModelLauncher.The function start at line 367 and ends at 385. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [367.0] and does not return any value. It declar... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_get_launch_params_with_non_power_of_two_gpus | def test_get_launch_params_with_non_power_of_two_gpus(self, mock_load_config, batch_model_configs):"""Test error when total GPUs is not a power of two."""# Need to add tensor parallelism to avoid the first validation errorupdated_configs = [batch_model_configs[0].model_copy(update={"gpus_per_node": 3,"vllm_args": {"--t... | 1 | 21 | 3 | 94 | 0 | 388 | 412 | 388 | self,mock_load_config,batch_model_configs | [] | None | {"Assign": 2, "Expr": 2, "With": 1} | 6 | 25 | 6 | ["model_copy", "pytest.raises", "BatchModelLauncher", "str", "str", "patch"] | 0 | [] | The function (test_get_launch_params_with_non_power_of_two_gpus) defined within the public class called TestBatchModelLauncher.The function start at line 388 and ends at 412. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [388.0] and does not return any value... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_get_launch_params_with_mismatched_batch_args | def test_get_launch_params_with_mismatched_batch_args(self, mock_load_config, batch_model_configs):"""Test error when batch mode required arguments don't match."""# Create a scenario where the batch argument validation actually fails# Let's use different GPU configurations that will pass all other validations# but fail... | 1 | 21 | 3 | 93 | 0 | 415 | 441 | 415 | self,mock_load_config,batch_model_configs | [] | None | {"Assign": 2, "Expr": 2, "With": 1} | 6 | 27 | 6 | ["model_copy", "model_copy", "pytest.raises", "BatchModelLauncher", "str", "patch"] | 0 | [] | The function (test_get_launch_params_with_mismatched_batch_args) defined within the public class called TestBatchModelLauncher.The function start at line 415 and ends at 441. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [415.0] and does not return any value... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_launch_success | def test_launch_success(self,mock_write_text,mock_read_text,mock_exists,mock_copy2,mock_rename,mock_open,mock_touch,mock_mkdir,mock_run_bash,mock_script_gen,mock_load_config,batch_model_configs,):"""Test successful batch model launch returns expected response."""mock_open.return_value = mock.mock_open().return_valuemoc... | 1 | 46 | 13 | 195 | 0 | 454 | 506 | 454 | self,mock_write_text,mock_read_text,mock_exists,mock_copy2,mock_rename,mock_open,mock_touch,mock_mkdir,mock_run_bash,mock_script_gen,mock_load_config,batch_model_configs | [] | None | {"Assign": 13, "Expr": 5} | 22 | 53 | 22 | ["mock.mock_open", "MagicMock", "Path", "Path", "Path", "BatchModelLauncher", "launcher.launch", "mock_mkdir.assert_called", "mock_touch.assert_called", "mock_copy2.assert_called", "mock_rename.assert_called", "patch", "patch", "patch", "patch", "patch", "patch", "patch", "patch", "patch", "patch", "patch"] | 0 | [] | The function (test_launch_success) defined within the public class called TestBatchModelLauncher.The function start at line 454 and ends at 506. It contains 46 lines of code and it has a cyclomatic complexity of 1. It takes 13 parameters, represented as [454.0] and does not return any value. It declares 22.0 functions,... |
VectorInstitute_vector-inference | TestModelLauncher | public | 0 | 0 | test_launch_with_slurm_error | def test_launch_with_slurm_error(self, mock_run_bash, mock_load_config, batch_model_configs):"""Test launch raises error on SLURM submission failure."""mock_load_config.return_value = batch_model_configsmock_run_bash.return_value = ("", "sbatch: error: Invalid partition specified")launcher = BatchModelLauncher(["family... | 1 | 12 | 4 | 58 | 0 | 510 | 523 | 510 | self,mock_run_bash,mock_load_config,model_config | [] | None | {"Assign": 3, "Expr": 2, "With": 1} | 5 | 10 | 5 | ["ModelLauncher", "pytest.raises", "launcher.launch", "patch", "patch"] | 0 | [] | The function (test_launch_with_slurm_error) defined within the public class called TestModelLauncher.The function start at line 510 and ends at 523. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [510.0] and does not return any value. It declares 5.0 function... |
VectorInstitute_vector-inference | TestBatchModelLauncher | public | 0 | 0 | test_launch_params_het_group_ids | def test_launch_params_het_group_ids(self, mock_load_config, batch_model_configs):"""Test that heterogeneous group IDs are assigned correctly."""mock_load_config.return_value = batch_model_configslauncher = BatchModelLauncher(["family1-variant1", "family2-variant1"],account="test-account",work_dir="/tmp/test-work",)par... | 1 | 10 | 3 | 65 | 0 | 526 | 538 | 526 | self,mock_load_config,batch_model_configs | [] | None | {"Assign": 3, "Expr": 1} | 2 | 13 | 2 | ["BatchModelLauncher", "patch"] | 0 | [] | The function (test_launch_params_het_group_ids) defined within the public class called TestBatchModelLauncher.The function start at line 526 and ends at 538. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [526.0] and does not return any value. It declares 2.0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.