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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sema4AI_actions | public | public | 0 | 0 | test_actions_secret_without_request_in_header_directly | def test_actions_secret_without_request_in_header_directly(datadir: Path):from devutils.fixtures import sema4ai_actions_run# Specifies the request in the json input.json_output = datadir / "json.output"json_input_contents = {"request": {"headers": {"x-my-password": "this-is-the-secret"}},}input_json = datadir / "json.i... | 1 | 17 | 1 | 88 | 4 | 135 | 156 | 135 | datadir | ['json_output', 'input_json', 'args', 'json_input_contents'] | None | {"Assign": 4, "Expr": 2} | 5 | 22 | 5 | ["input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "json_output.read_text"] | 0 | [] | The function (test_actions_secret_without_request_in_header_directly) defined within the public class called public.The function start at line 135 and ends at 156. 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 5... |
Sema4AI_actions | public | public | 0 | 0 | agent_dummy_server | def agent_dummy_server():server = AgentDummyServer()server.start()yield serverserver.stop() | 1 | 5 | 0 | 21 | 1 | 8 | 12 | 8 | ['server'] | None | {"Assign": 1, "Expr": 3} | 3 | 5 | 3 | ["AgentDummyServer", "server.start", "server.stop"] | 0 | [] | The function (agent_dummy_server) defined within the public class called public.The function start at line 8 and ends at 12. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functions ... | |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_with_thread_id | def test_prompt_generate_with_thread_id(agent_dummy_server):"""Test prompt_generate with thread_id parameter."""import osfrom sema4ai.actions.agent import prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_URL"] = f"http://localhost:{agent_dummy_server.get_port(... | 1 | 38 | 1 | 148 | 2 | 15 | 64 | 15 | agent_dummy_server | ['prompt', 'response'] | None | {"Assign": 3, "Expr": 1} | 2 | 50 | 2 | ["agent_dummy_server.get_port", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_with_thread_id) defined within the public class called public.The function start at line 15 and ends at 64. It contains 38 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... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_with_agent_id_and_model_name | def test_prompt_generate_with_agent_id_and_model_name(agent_dummy_server):"""Test prompt_generate with agent_id parameter."""import osfrom sema4ai.actions.agent import prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_URL"] = f"http://localhost:{agent_dummy_ser... | 1 | 35 | 1 | 151 | 2 | 67 | 113 | 67 | agent_dummy_server | ['prompt', 'response'] | None | {"Assign": 3, "Expr": 1} | 2 | 47 | 2 | ["agent_dummy_server.get_port", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_with_agent_id_and_model_name) defined within the public class called public.The function start at line 67 and ends at 113. It contains 35 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 fun... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_with_platform_config | def test_prompt_generate_with_platform_config(agent_dummy_server):"""Test prompt_generate with platform_config parameter."""import osfrom sema4ai.actions.agent import OpenAIPlatformParameters, prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_URL"] = f"http://l... | 1 | 33 | 1 | 163 | 3 | 116 | 162 | 116 | agent_dummy_server | ['platform_config', 'prompt', 'response'] | None | {"Assign": 4, "Expr": 1} | 3 | 47 | 3 | ["agent_dummy_server.get_port", "OpenAIPlatformParameters", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_with_platform_config) defined within the public class called public.The function start at line 116 and ends at 162. 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 3.0 functions,... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_complex_prompt | def test_prompt_generate_complex_prompt(agent_dummy_server):"""Test prompt_generate with the complex prompt structure from the user query."""import osfrom sema4ai.actions.agent import prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_URL"] = f"http://localhost:... | 1 | 74 | 1 | 261 | 2 | 165 | 250 | 165 | agent_dummy_server | ['prompt', 'response'] | None | {"Assign": 3, "Expr": 1} | 2 | 86 | 2 | ["agent_dummy_server.get_port", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_complex_prompt) defined within the public class called public.The function start at line 165 and ends at 250. It contains 74 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 ... |
Sema4AI_actions | public | public | 0 | 0 | test_get_thread_id_from_headers | def test_get_thread_id_from_headers(datadir: Path):"""Test get_thread_id function using headers."""import jsonfrom devutils.fixtures import sema4ai_actions_run# Create a simple action inline for testingaction_code = '''from sema4ai.actions import actionfrom sema4ai.actions.agent import get_thread_id@actiondef action_ge... | 1 | 36 | 1 | 111 | 7 | 253 | 299 | 253 | datadir | ['action_file', 'args', 'output', 'input_json', 'result', 'json_input_contents', 'action_code'] | None | {"Assign": 7, "Expr": 3} | 6 | 47 | 6 | ["action_file.write_text", "input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_get_thread_id_from_headers) defined within the public class called public.The function start at line 253 and ends at 299. It contains 36 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 h... |
Sema4AI_actions | public | public | 0 | 0 | test_get_agent_id_from_headers | def test_get_agent_id_from_headers(datadir: Path):"""Test get_agent_id function using headers."""import jsonfrom devutils.fixtures import sema4ai_actions_run# Create a simple action inline for testingaction_code = '''from sema4ai.actions import actionfrom sema4ai.actions.agent import get_agent_id@actiondef action_get_a... | 1 | 36 | 1 | 111 | 7 | 302 | 348 | 302 | datadir | ['action_file', 'args', 'output', 'input_json', 'result', 'json_input_contents', 'action_code'] | None | {"Assign": 7, "Expr": 3} | 6 | 47 | 6 | ["action_file.write_text", "input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_get_agent_id_from_headers) defined within the public class called public.The function start at line 302 and ends at 348. It contains 36 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 ha... |
Sema4AI_actions | public | public | 0 | 0 | test_get_thread_id_from_invocation_context | def test_get_thread_id_from_invocation_context(datadir: Path):"""Test get_thread_id function using invocation context."""import base64import jsonfrom devutils.fixtures import sema4ai_actions_run# Create a simple action inline for testingaction_code = '''from sema4ai.actions import actionfrom sema4ai.actions.agent impor... | 1 | 41 | 1 | 144 | 8 | 351 | 403 | 351 | datadir | ['action_file', 'args', 'output', 'invocation_context', 'input_json', 'result', 'json_input_contents', 'action_code'] | None | {"Assign": 8, "Expr": 3} | 10 | 53 | 10 | ["action_file.write_text", "decode", "base64.b64encode", "encode", "json.dumps", "input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_get_thread_id_from_invocation_context) defined within the public class called public.The function start at line 351 and ends at 403. It contains 41 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 10.0 function... |
Sema4AI_actions | public | public | 0 | 0 | test_get_agent_id_from_invocation_context | def test_get_agent_id_from_invocation_context(datadir: Path):"""Test get_agent_id function using invocation context."""import base64import jsonfrom devutils.fixtures import sema4ai_actions_run# Create a simple action inline for testingaction_code = '''from sema4ai.actions import actionfrom sema4ai.actions.agent import ... | 1 | 41 | 1 | 144 | 8 | 406 | 458 | 406 | datadir | ['action_file', 'args', 'output', 'invocation_context', 'input_json', 'result', 'json_input_contents', 'action_code'] | None | {"Assign": 8, "Expr": 3} | 10 | 53 | 10 | ["action_file.write_text", "decode", "base64.b64encode", "encode", "json.dumps", "input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_get_agent_id_from_invocation_context) defined within the public class called public.The function start at line 406 and ends at 458. It contains 41 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 10.0 functions... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_no_validation_with_dicts | def test_prompt_no_validation_with_dicts(agent_dummy_server):"""Test that prompt_generate handles validation correctly: dicts are not validated."""import osfrom sema4ai.actions.agent import prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_URL"] = f"http://loca... | 1 | 45 | 1 | 144 | 3 | 461 | 518 | 461 | agent_dummy_server | ['invalid_content_dict', 'response', 'invalid_dict_prompt'] | None | {"Assign": 5, "Expr": 1} | 3 | 58 | 3 | ["agent_dummy_server.get_port", "prompt_generate", "prompt_generate"] | 0 | [] | The function (test_prompt_no_validation_with_dicts) defined within the public class called public.The function start at line 461 and ends at 518. It contains 45 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 ... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_with_pydantic_models | def test_prompt_generate_with_pydantic_models(agent_dummy_server):"""Test prompt_generate with Pydantic models to ensure validation and model_dump() works correctly."""import osfrom sema4ai.actions.agent import (OpenAIPlatformParameters,Prompt,PromptTextContent,PromptUserMessage,prompt_generate,)# Set the environment v... | 1 | 36 | 1 | 166 | 3 | 521 | 570 | 521 | agent_dummy_server | ['platform_config', 'prompt', 'response'] | None | {"Assign": 4, "Expr": 1} | 6 | 50 | 6 | ["agent_dummy_server.get_port", "Prompt", "PromptUserMessage", "PromptTextContent", "OpenAIPlatformParameters", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_with_pydantic_models) defined within the public class called public.The function start at line 521 and ends at 570. It contains 36 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,... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_with_dicts_no_validation | def test_prompt_generate_with_dicts_no_validation(agent_dummy_server):"""Test that prompt_generate accepts invalid dicts without validation (escape hatch behavior)."""import osfrom sema4ai.actions.agent import prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_U... | 1 | 37 | 1 | 142 | 2 | 573 | 622 | 573 | agent_dummy_server | ['response', 'invalid_prompt'] | None | {"Assign": 3, "Expr": 1} | 2 | 50 | 2 | ["agent_dummy_server.get_port", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_with_dicts_no_validation) defined within the public class called public.The function start at line 573 and ends at 622. It contains 37 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 functi... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_pydantic_validation_errors | def test_prompt_generate_pydantic_validation_errors(agent_dummy_server):"""Test that prompt_generate raises Pydantic validation errors when called with invalid Pydantic models."""import osimport pytestfrom pydantic import ValidationErrorfrom sema4ai.actions.agent import (Prompt,PromptTextContent,PromptUserMessage,promp... | 1 | 56 | 1 | 222 | 1 | 625 | 696 | 625 | agent_dummy_server | ['error_msg'] | None | {"Assign": 4, "Expr": 4, "With": 3} | 22 | 72 | 22 | ["agent_dummy_server.get_port", "pytest.raises", "prompt_generate", "Prompt", "PromptUserMessage", "PromptTextContent", "str", "error_msg.lower", "pytest.raises", "prompt_generate", "Prompt", "PromptUserMessage", "PromptTextContent", "str", "error_msg.lower", "pytest.raises", "prompt_generate", "Prompt", "PromptUserMes... | 0 | [] | The function (test_prompt_generate_pydantic_validation_errors) defined within the public class called public.The function start at line 625 and ends at 696. It contains 56 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 22.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_mixed_dict_and_pydantic | def test_prompt_generate_mixed_dict_and_pydantic(agent_dummy_server):"""Test prompt_generate with mixed dict and Pydantic model inputs."""import osfrom sema4ai.actions.agent import OpenAIPlatformParameters, prompt_generate# Set the environment variable to point to our dummy serveros.environ["SEMA4AI_AGENTS_SERVICE_URL"... | 1 | 36 | 1 | 156 | 3 | 699 | 749 | 699 | agent_dummy_server | ['platform_config', 'response', 'prompt_dict'] | None | {"Assign": 4, "Expr": 1} | 3 | 51 | 3 | ["agent_dummy_server.get_port", "OpenAIPlatformParameters", "prompt_generate"] | 0 | [] | The function (test_prompt_generate_mixed_dict_and_pydantic) defined within the public class called public.The function start at line 699 and ends at 749. It contains 36 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 functio... |
Sema4AI_actions | public | public | 0 | 0 | test_prompt_generate_model_dump_behavior | def test_prompt_generate_model_dump_behavior(agent_dummy_server):"""Test that model_dump() is called correctly for Pydantic models."""import osfrom sema4ai.actions.agent import (OpenAIPlatformParameters,Prompt,PromptTextContent,PromptUserMessage,prompt_generate,)# Set the environment variable to point to our dummy serv... | 1 | 38 | 1 | 194 | 4 | 752 | 808 | 752 | agent_dummy_server | ['platform_config', 'prompt', 'request_body', 'response'] | None | {"Assign": 5, "Expr": 1} | 8 | 57 | 8 | ["agent_dummy_server.get_port", "Prompt", "PromptUserMessage", "PromptTextContent", "OpenAIPlatformParameters", "prompt_generate", "isinstance", "isinstance"] | 0 | [] | The function (test_prompt_generate_model_dump_behavior) defined within the public class called public.The function start at line 752 and ends at 808. It contains 38 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, ... |
Sema4AI_actions | public | public | 0 | 0 | dummy_server | def dummy_server(tmpdir):from actions_tests.files_dummy_server import FilesDummyServerret = FilesDummyServer(Path(tmpdir) / "files")ret.start()yield retret.stop() | 1 | 6 | 1 | 34 | 1 | 7 | 13 | 7 | tmpdir | ['ret'] | None | {"Assign": 1, "Expr": 3} | 4 | 7 | 4 | ["FilesDummyServer", "Path", "ret.start", "ret.stop"] | 0 | [] | The function (dummy_server) defined within the public class called public.The function start at line 7 and ends at 13. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functions called... |
Sema4AI_actions | public | public | 0 | 0 | test_client_local_mode | def test_client_local_mode(tmpdir):from sema4ai.actions.chat import _clientp = Path(tmpdir)uri = p.as_uri()client = _client._Client(uri)assert client.is_local_mode()client.set_bytes("test.txt", b"some-content", thread_id="some-thread-id")assert client.get_bytes("test.txt", thread_id="some-thread-id") == b"some-content" | 1 | 8 | 1 | 67 | 3 | 16 | 25 | 16 | tmpdir | ['client', 'p', 'uri'] | None | {"Assign": 3, "Expr": 1} | 6 | 10 | 6 | ["Path", "p.as_uri", "_client._Client", "client.is_local_mode", "client.set_bytes", "client.get_bytes"] | 0 | [] | The function (test_client_local_mode) defined within the public class called public.The function start at line 16 and ends at 25. 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 6.0 functions, and It has 6.0 funct... |
Sema4AI_actions | public | public | 0 | 0 | test_client_server_write_to_local | def test_client_server_write_to_local(dummy_server):from sema4ai.actions.chat import _clienturi = f"http://localhost:{dummy_server.get_port()}"client = _client._Client(uri)assert not client.is_local_mode()client.set_bytes("test.txt", b"some-content", thread_id="some-thread-id")assert client.get_bytes("test.txt", thread... | 1 | 7 | 1 | 59 | 2 | 28 | 36 | 28 | dummy_server | ['client', 'uri'] | None | {"Assign": 2, "Expr": 1} | 5 | 9 | 5 | ["dummy_server.get_port", "_client._Client", "client.is_local_mode", "client.set_bytes", "client.get_bytes"] | 0 | [] | The function (test_client_server_write_to_local) defined within the public class called public.The function start at line 28 and ends at 36. 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 5.0 functions, and It ha... |
Sema4AI_actions | public | public | 0 | 0 | test_client_server_write_to_url | def test_client_server_write_to_url(dummy_server):from sema4ai.actions.chat import _clientdummy_server.set_write_to_local(False)uri = f"http://localhost:{dummy_server.get_port()}"client = _client._Client(uri)assert not client.is_local_mode()client.set_bytes("test.txt", b"some-content", thread_id="some-thread-id")assert... | 1 | 11 | 1 | 67 | 2 | 39 | 52 | 39 | dummy_server | ['client', 'uri'] | None | {"Assign": 2, "Expr": 2} | 6 | 14 | 6 | ["dummy_server.set_write_to_local", "dummy_server.get_port", "_client._Client", "client.is_local_mode", "client.set_bytes", "client.get_bytes"] | 0 | [] | The function (test_client_server_write_to_url) defined within the public class called public.The function start at line 39 and ends at 52. 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... |
Sema4AI_actions | public | public | 0 | 0 | test_actions_file_api | def test_actions_file_api(monkeypatch, tmpdir):monkeypatch.setenv("SEMA4AI_FILE_MANAGEMENT_URL", Path(tmpdir).as_uri())from sema4ai.actions import chatchat.attach_file_content("my-file.txt", b"some text")assert chat.get_file_content("my-file.txt") == b"some text"# By default, the file is not overwritten!chat.attach_fil... | 1 | 7 | 2 | 66 | 0 | 55 | 67 | 55 | monkeypatch,tmpdir | [] | None | {"Expr": 3} | 7 | 13 | 7 | ["monkeypatch.setenv", "as_uri", "Path", "chat.attach_file_content", "chat.get_file_content", "chat.attach_file_content", "chat.get_file_content"] | 0 | [] | The function (test_actions_file_api) defined within the public class called public.The function start at line 55 and ends at 67. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [55.0] and does not return any value. It declares 7.0 functions, and It has 7.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | test_actions_with_agent_headers_call_from_agent_server | def test_actions_with_agent_headers_call_from_agent_server(datadir: Path):import jsonfrom devutils.fixtures import sema4ai_actions_run# Specifies the request in the json input.json_output = datadir / "json.output"json_input_contents = {"custom_cls": {"filename": str(json_output), "price": 100},"request": {"headers": {"... | 1 | 34 | 1 | 142 | 7 | 70 | 110 | 70 | datadir | ['env', 'args', 'output', 'json_output', 'input_json', 'result', 'json_input_contents'] | None | {"Assign": 7, "Expr": 1} | 6 | 41 | 6 | ["str", "input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_actions_with_agent_headers_call_from_agent_server) defined within the public class called public.The function start at line 70 and ends at 110. It contains 34 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.... |
Sema4AI_actions | public | public | 0 | 0 | test_actions_with_agent_headers_call_with_invocation_context | def test_actions_with_agent_headers_call_with_invocation_context(datadir: Path):import base64import jsonfrom devutils.fixtures import sema4ai_actions_run# Specifies the request in the json input.json_output = datadir / "json.output"invocation_context = base64.b64encode(json.dumps({"agent_id": "agent-id-123","invoked_on... | 1 | 39 | 1 | 175 | 8 | 113 | 160 | 113 | datadir | ['env', 'args', 'output', 'invocation_context', 'json_output', 'input_json', 'result', 'json_input_contents'] | None | {"Assign": 8, "Expr": 1} | 10 | 48 | 10 | ["decode", "base64.b64encode", "encode", "json.dumps", "str", "input_json.write_text", "json.dumps", "sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_actions_with_agent_headers_call_with_invocation_context) defined within the public class called public.The function start at line 113 and ends at 160. 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 decl... |
Sema4AI_actions | public | public | 0 | 0 | _fix_file | def _fix_file(entry):import os.pathentry["file"] = os.path.basename(entry["file"]) | 1 | 3 | 1 | 25 | 0 | 1 | 4 | 1 | entry | [] | None | {"Assign": 1} | 1 | 4 | 1 | ["os.path.basename"] | 7 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3956520_asottile_reorder_python_imports.reorder_python_imports_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94655760_MarcoGorelli_polars_upgrade.polars_upgrade._main_py.main", "_.content.gdrive.MyDrive.Ph... | The function (_fix_file) defined within the public class called public.The function start at line 1 and ends at 4. It contains 3 lines of code and it has a cyclomatic complexity of 1. It take 1 parameter, represented as [1.0] and does not return any value. It declare 1.0 function, It has 1.0 function called inside whic... |
Sema4AI_actions | public | public | 0 | 0 | test_actions_list_relative_import | def test_actions_list_relative_import(datadir, data_regression):import jsonfrom devutils.fixtures import sema4ai_actions_runresult = sema4ai_actions_run(["list", "--skip-lint"], returncode=0, cwd=str(datadir))found = json.loads(result.stdout)print(result.stderr.decode("utf-8"))for entry in found:_fix_file(entry)data_re... | 2 | 13 | 2 | 92 | 2 | 7 | 21 | 7 | datadir,data_regression | ['result', 'found'] | None | {"Assign": 2, "Expr": 3, "For": 1} | 8 | 15 | 8 | ["sema4ai_actions_run", "str", "json.loads", "print", "result.stderr.decode", "_fix_file", "data_regression.check", "sorted"] | 0 | [] | The function (test_actions_list_relative_import) defined within the public class called public.The function start at line 7 and ends at 21. It contains 13 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [7.0] and does not return any value. It declares 8.0 functions, and It ... |
Sema4AI_actions | public | public | 0 | 0 | test_actions_run_relative_import | def test_actions_run_relative_import(datadir, data_regression):from devutils.fixtures import sema4ai_actions_run# Just check that it runs.sema4ai_actions_run(["run", "-a", "my_action"], returncode=0, cwd=str(datadir)) | 1 | 3 | 2 | 34 | 0 | 24 | 28 | 24 | datadir,data_regression | [] | None | {"Expr": 1} | 2 | 5 | 2 | ["sema4ai_actions_run", "str"] | 0 | [] | The function (test_actions_run_relative_import) defined within the public class called public.The function start at line 24 and ends at 28. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [24.0] and does not return any value. It declares 2.0 functions, and It ... |
Sema4AI_actions | public | public | 0 | 0 | test_help | def test_help(args, str_regression):v = sys.version_info[:2]if v < (3, 10):returnif v > (3, 10):raise RuntimeError(f"This test must be migrated to {v} (always the major version supported should be tested)")from devutils.fixtures import sema4ai_actions_runstr_regression.check(sema4ai_actions_run(args, returncode=0).stdo... | 3 | 10 | 2 | 67 | 1 | 7 | 17 | 7 | args,str_regression | ['v'] | None | {"Assign": 1, "Expr": 1, "If": 2, "Return": 1} | 5 | 11 | 5 | ["RuntimeError", "str_regression.check", "stdout.decode", "sema4ai_actions_run", "pytest.mark.parametrize"] | 0 | [] | The function (test_help) defined within the public class called public.The function start at line 7 and ends at 17. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [7.0] and does not return any value. It declares 5.0 functions, and It has 5.0 functions called... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_no_docstring | def test_lint_action_no_docstring(data_regression):from sema4ai.actions._lint_action import iter_lint_errorscontents = """@actiondef my_action():pass"""data_regression.check([x.to_lsp_diagnostic() for x in iter_lint_errors(contents)]) | 2 | 8 | 1 | 35 | 1 | 8 | 17 | 8 | data_regression | ['contents'] | None | {"Assign": 1, "Expr": 1} | 3 | 10 | 3 | ["data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors"] | 0 | [] | The function (test_lint_action_no_docstring) defined within the public class called public.The function start at line 8 and ends at 17. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_no_docstring_in_query_and_predict | def test_lint_action_no_docstring_in_query_and_predict(data_regression):from sema4ai.actions._lint_action import iter_lint_errorscontents = """@querydef my_action():pass@predictdef my_action():pass"""data_regression.check([x.to_lsp_diagnostic() for x in iter_lint_errors(contents)]) | 2 | 12 | 1 | 35 | 1 | 20 | 33 | 20 | data_regression | ['contents'] | None | {"Assign": 1, "Expr": 1} | 3 | 14 | 3 | ["data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors"] | 0 | [] | The function (test_lint_action_no_docstring_in_query_and_predict) defined within the public class called public.The function start at line 20 and ends at 33. It contains 12 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_docstring_not_matching | def test_lint_action_docstring_not_matching(data_regression):from sema4ai.actions._lint_action import iter_lint_errorscontents = """@actiondef my_action(param1: str) -> str:'''Empty docstring?'''return ''"""data_regression.check([x.to_lsp_diagnostic() for x in iter_lint_errors(contents)])contents = """@actions.actionde... | 3 | 20 | 1 | 57 | 1 | 36 | 59 | 36 | data_regression | ['contents'] | None | {"Assign": 2, "Expr": 2} | 6 | 24 | 6 | ["data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors", "data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors"] | 0 | [] | The function (test_lint_action_docstring_not_matching) defined within the public class called public.The function start at line 36 and ends at 59. It contains 20 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 6.0 functions, and... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_no_description | def test_lint_action_no_description(data_regression):from sema4ai.actions.api import collect_lint_errorscontents = """@actiondef my_action(param1) -> str:'''Args:param1: Some value.'''return ''"""data_regression.check(collect_lint_errors(contents)) | 1 | 12 | 1 | 25 | 1 | 62 | 75 | 62 | data_regression | ['contents'] | None | {"Assign": 1, "Expr": 1} | 2 | 14 | 2 | ["data_regression.check", "collect_lint_errors"] | 0 | [] | The function (test_lint_action_no_description) defined within the public class called public.The function start at line 62 and ends at 75. 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 2.0 functions, and It has... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_argument_untyped | def test_lint_action_argument_untyped(data_regression):from sema4ai.actions._lint_action import iter_lint_errorscontents = """@actiondef my_action(param1) -> str:'''Some Action.Args:param1: Some value.'''return ''"""data_regression.check([x.to_lsp_diagnostic() for x in iter_lint_errors(contents)]) | 2 | 14 | 1 | 35 | 1 | 78 | 93 | 78 | data_regression | ['contents'] | None | {"Assign": 1, "Expr": 1} | 3 | 16 | 3 | ["data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors"] | 0 | [] | The function (test_lint_action_argument_untyped) defined within the public class called public.The function start at line 78 and ends at 93. It contains 14 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It h... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_with_is_consequential | def test_lint_action_with_is_consequential(data_regression):from sema4ai.actions._lint_action import iter_lint_errorscontents = """from sema4ai.actions import action@action(is_consequential=True)def my_action(param1: str) -> str:'''Some Action.'''return ''"""data_regression.check([x.to_lsp_diagnostic() for x in iter_li... | 2 | 13 | 1 | 35 | 1 | 96 | 110 | 96 | data_regression | ['contents'] | None | {"Assign": 1, "Expr": 1} | 3 | 15 | 3 | ["data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors"] | 0 | [] | The function (test_lint_action_with_is_consequential) defined within the public class called public.The function start at line 96 and ends at 110. It contains 13 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, and... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_big_description | def test_lint_action_big_description(data_regression, monkeypatch):from sema4ai.actions._lint_action import iter_lint_errorsmonkeypatch.setattr("sema4ai.actions._lint_action.MAX_DOCS_LENGTH", 300)contents = """@actiondef my_action() -> str:'''This description is too big. OpenAI just supports 300 hundred chars in desc.T... | 2 | 16 | 2 | 45 | 1 | 113 | 131 | 113 | data_regression,monkeypatch | ['contents'] | None | {"Assign": 1, "Expr": 2} | 4 | 19 | 4 | ["monkeypatch.setattr", "data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors"] | 0 | [] | The function (test_lint_action_big_description) defined within the public class called public.The function start at line 113 and ends at 131. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [113.0] and does not return any value. It declares 4.0 functions, and ... |
Sema4AI_actions | public | public | 0 | 0 | clean_filename_to_basename | def clean_filename_to_basename(obj: Any) -> Any:# Any dict with a key `file` will have the value of the key `file` replaced with the basename of the file.if isinstance(obj, dict):if "file" in obj:obj["file"] = os.path.basename(obj["file"])return {k: clean_filename_to_basename(v) for k, v in obj.items()}elif isinstance(... | 6 | 8 | 1 | 78 | 0 | 134 | 142 | 134 | obj | [] | Any | {"Assign": 1, "If": 3, "Return": 3} | 6 | 9 | 6 | ["isinstance", "os.path.basename", "clean_filename_to_basename", "obj.items", "isinstance", "clean_filename_to_basename"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_tests.test_lint_actions_py.clean_filename_to_basename", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_tests.test_lint_act... | The function (clean_filename_to_basename) defined within the public class called public.The function start at line 134 and ends at 142. It contains 8 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 func... |
Sema4AI_actions | public | public | 0 | 0 | find_issues_in_actions_list | def find_issues_in_actions_list(datadir: Path, contents: str) -> list:import jsonfrom devutils.fixtures import sema4ai_actions_runcwd = datadir / "cwd"os.makedirs(cwd)act = cwd / "act.py"act.write_text(contents)result = sema4ai_actions_run(["list"], returncode="any", cwd=str(cwd))try:found = json.loads(result.stdout)ex... | 3 | 18 | 2 | 110 | 5 | 145 | 166 | 145 | datadir,contents | ['found', 'act', 'cwd', 'result', 'lint_result'] | list | {"Assign": 5, "Expr": 2, "If": 1, "Return": 2, "Try": 1} | 11 | 22 | 11 | ["os.makedirs", "act.write_text", "sema4ai_actions_run", "str", "json.loads", "RuntimeError", "result.stdout.decode", "result.stderr.decode", "isinstance", "found.get", "clean_filename_to_basename"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_tests.test_lint_actions_py.test_lint_action_oauth2_secret", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_tests.test_lint... | The function (find_issues_in_actions_list) defined within the public class called public.The function start at line 145 and ends at 166. It contains 18 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [145.0] and does not return any value. It declares 11.0 functions, It has 1... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_integrated | def test_lint_action_integrated(datadir, data_regression):import jsonfrom devutils.fixtures import sema4ai_actions_runresult = sema4ai_actions_run(["list"], returncode="error", cwd=str(datadir))try:found = json.loads(result.stdout)except Exception:raise RuntimeError(f"stdout: {result.stdout.decode('utf-8')}\nstderr: {r... | 4 | 18 | 2 | 108 | 4 | 169 | 190 | 169 | datadir,data_regression | ['result', 'lint_result', 'found', 'new_dict'] | None | {"Assign": 6, "Expr": 1, "For": 1, "If": 1, "Try": 1} | 9 | 22 | 9 | ["sema4ai_actions_run", "str", "json.loads", "RuntimeError", "result.stdout.decode", "result.stderr.decode", "lint_result.items", "os.path.basename", "data_regression.check"] | 0 | [] | The function (test_lint_action_integrated) defined within the public class called public.The function start at line 169 and ends at 190. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [169.0] and does not return any value. It declares 9.0 functions, and It h... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_secret | def test_lint_action_secret(data_regression, datadir):from sema4ai.actions._customization._extension_points import EPManagedParametersfrom sema4ai.actions._customization._plugin_manager import PluginManagerfrom sema4ai.actions._lint_action import iter_lint_errorsfrom sema4ai.actions._managed_parameters import ManagedPa... | 2 | 23 | 2 | 104 | 3 | 193 | 218 | 193 | data_regression,datadir | ['issues', 'contents', 'pm'] | None | {"Assign": 3, "Expr": 3} | 8 | 26 | 8 | ["PluginManager", "pm.set_instance", "ManagedParameters", "data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors", "find_issues_in_actions_list", "data_regression.check"] | 0 | [] | The function (test_lint_action_secret) defined within the public class called public.The function start at line 193 and ends at 218. It contains 23 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [193.0] and does not return any value. It declares 8.0 functions, and It has 8... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_action_oauth2_secret | def test_lint_action_oauth2_secret(data_regression, datadir):from sema4ai.actions._customization._extension_points import EPManagedParametersfrom sema4ai.actions._customization._plugin_manager import PluginManagerfrom sema4ai.actions._lint_action import iter_lint_errorsfrom sema4ai.actions._managed_parameters import Ma... | 2 | 30 | 2 | 104 | 3 | 221 | 253 | 221 | data_regression,datadir | ['issues', 'contents', 'pm'] | None | {"Assign": 3, "Expr": 3} | 8 | 33 | 8 | ["PluginManager", "pm.set_instance", "ManagedParameters", "data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors", "find_issues_in_actions_list", "data_regression.check"] | 0 | [] | The function (test_lint_action_oauth2_secret) defined within the public class called public.The function start at line 221 and ends at 253. It contains 30 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [221.0] and does not return any value. It declares 8.0 functions, and I... |
Sema4AI_actions | public | public | 0 | 0 | test_lint_data_source_docstring_not_required | def test_lint_data_source_docstring_not_required(data_regression, datadir, scenario):from sema4ai.actions._customization._extension_points import EPManagedParametersfrom sema4ai.actions._customization._plugin_manager import PluginManagerfrom sema4ai.actions._lint_action import iter_lint_errorsfrom sema4ai.actions._mana... | 5 | 82 | 3 | 117 | 2 | 257 | 340 | 257 | data_regression,datadir,scenario | ['contents', 'pm'] | None | {"Assign": 4, "Expr": 2, "If": 3} | 8 | 84 | 8 | ["ValueError", "PluginManager", "pm.set_instance", "ManagedParameters", "data_regression.check", "x.to_lsp_diagnostic", "iter_lint_errors", "pytest.mark.parametrize"] | 0 | [] | The function (test_lint_data_source_docstring_not_required) defined within the public class called public.The function start at line 257 and ends at 340. It contains 82 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [257.0] and does not return any value. It declares 8.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | test_print_result | def test_print_result(datadir):from devutils.fixtures import sema4ai_actions_runargs = ["run","-a","greet_fail_with_action_error",datadir,"--print-input","--print-result",]result = sema4ai_actions_run(args, returncode=1, cwd=str(datadir))output = result.stdout.decode("utf-8")assert "result:" in outputassert '"result": ... | 1 | 15 | 1 | 66 | 3 | 1 | 17 | 1 | datadir | ['result', 'args', 'output'] | None | {"Assign": 3} | 3 | 17 | 3 | ["sema4ai_actions_run", "str", "result.stdout.decode"] | 0 | [] | The function (test_print_result) defined within the public class called public.The function start at line 1 and ends at 17. It contains 15 lines of code and it has a cyclomatic complexity of 1. It take 1 parameter, represented as [1.0] and does not return any value. It declares 3.0 functions, and It has 3.0 functions ... |
Sema4AI_actions | public | public | 0 | 0 | test_should_match_decorators_with_parameters | def test_should_match_decorators_with_parameters():"""Test that the regex matches decorators that have parameters."""pattern = re.compile(REGEXP_TO_LOAD_FOR_DEFINITIONS)# Test with parentheses and parametersassert pattern.search("@action()")assert pattern.search("@tool(name='test')")assert pattern.search("@prompt(descr... | 1 | 12 | 0 | 83 | 1 | 6 | 22 | 6 | ['pattern'] | None | {"Assign": 1, "Expr": 1} | 11 | 17 | 11 | ["re.compile", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search"] | 0 | [] | The function (test_should_match_decorators_with_parameters) defined within the public class called public.The function start at line 6 and ends at 22. 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 11.0 functions... | |
Sema4AI_actions | public | public | 0 | 0 | test_should_not_match_invalid_patterns | def test_should_not_match_invalid_patterns():"""Test that the regex doesn't match invalid patterns."""pattern = re.compile(REGEXP_TO_LOAD_FOR_DEFINITIONS)# Test invalid decoratorsassert not pattern.search("@invalid")assert not pattern.search("@mcp.invalid")assert not pattern.search("@mcp")assert not pattern.search("@mc... | 1 | 11 | 0 | 85 | 1 | 25 | 42 | 25 | ['pattern'] | None | {"Assign": 1, "Expr": 1} | 10 | 18 | 10 | ["re.compile", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search", "pattern.search"] | 0 | [] | The function (test_should_not_match_invalid_patterns) defined within the public class called public.The function start at line 25 and ends at 42. 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 10.0 functions, and... | |
Sema4AI_actions | public | public | 0 | 0 | test_should_match_all_expected_patterns | def test_should_match_all_expected_patterns():"""Test that all expected decorator patterns are matched."""pattern = re.compile(REGEXP_TO_LOAD_FOR_DEFINITIONS)expected_decorators = ["@action","@tool","@prompt","@resource","@query","@actions.query","@actions.action","@mcp.tool","@mcp.prompt","@mcp.resource",]for decorato... | 2 | 16 | 0 | 52 | 2 | 45 | 63 | 45 | ['pattern', 'expected_decorators'] | None | {"Assign": 2, "Expr": 1, "For": 1} | 2 | 19 | 2 | ["re.compile", "pattern.search"] | 0 | [] | The function (test_should_match_all_expected_patterns) defined within the public class called public.The function start at line 45 and ends at 63. It contains 16 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, and... | |
Sema4AI_actions | public | public | 0 | 0 | test_should_find_multiple_matches | def test_should_find_multiple_matches():"""Test that the regex can find multiple matches in a string."""pattern = re.compile(REGEXP_TO_LOAD_FOR_DEFINITIONS)code_with_multiple = """@actiondef action1():pass@tooldef tool1():pass@promptdef prompt1():pass"""matches = pattern.findall(code_with_multiple)assert len(matches) =... | 1 | 20 | 0 | 43 | 3 | 66 | 88 | 66 | ['code_with_multiple', 'matches', 'pattern'] | None | {"Assign": 3, "Expr": 1} | 3 | 23 | 3 | ["re.compile", "pattern.findall", "len"] | 0 | [] | The function (test_should_find_multiple_matches) defined within the public class called public.The function start at line 66 and ends at 88. 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 declares 3.0 functions, and It h... | |
Sema4AI_actions | public | public | 0 | 0 | _fix_file | def _fix_file(entry):entry["file"] = os.path.basename(entry["file"]) | 1 | 2 | 1 | 21 | 0 | 5 | 6 | 5 | entry | [] | None | {"Assign": 1} | 1 | 2 | 1 | ["os.path.basename"] | 7 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3956520_asottile_reorder_python_imports.reorder_python_imports_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94655760_MarcoGorelli_polars_upgrade.polars_upgrade._main_py.main", "_.content.gdrive.MyDrive.Ph... | The function (_fix_file) defined within the public class called public.The function start at line 5 and ends at 6. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside whic... |
Sema4AI_actions | public | public | 0 | 0 | test_actions_list_relative_import | def test_actions_list_relative_import(datadir, data_regression):from devutils.fixtures import sema4ai_actions_runresult = sema4ai_actions_run(["list", "--skip-lint"], returncode=0, cwd=str(datadir))found = json.loads(result.stdout)for entry in found:_fix_file(entry)data_regression.check(sorted(found, key=lambda entry: ... | 2 | 11 | 2 | 79 | 2 | 9 | 20 | 9 | datadir,data_regression | ['result', 'found'] | None | {"Assign": 2, "Expr": 2, "For": 1} | 6 | 12 | 6 | ["sema4ai_actions_run", "str", "json.loads", "_fix_file", "data_regression.check", "sorted"] | 0 | [] | The function (test_actions_list_relative_import) defined within the public class called public.The function start at line 9 and ends at 20. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [9.0] and does not return any value. It declares 6.0 functions, and It ... |
Sema4AI_actions | public | public | 0 | 0 | calculator_sum | def calculator_sum(v1: float, v2: float) -> float:"""Sums 2 numbers and returns them.Args:v1: First number.v2: Second number.Returns:The sum of v1 + v2."""return v1 + v2 | 1 | 2 | 2 | 18 | 0 | 5 | 16 | 5 | v1,v2 | [] | float | {"Expr": 1, "Return": 1} | 0 | 12 | 0 | [] | 0 | [] | The function (calculator_sum) defined within the public class called public.The function start at line 5 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [5.0] and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | broken_task | def broken_task() -> int:"""This always raises an error."""raise RuntimeError("This is broken") | 1 | 2 | 0 | 12 | 0 | 20 | 24 | 20 | [] | int | {"Expr": 1} | 1 | 5 | 1 | ["RuntimeError"] | 0 | [] | The function (broken_task) defined within the public class called public.The function start at line 20 and ends at 24. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called in... | |
Sema4AI_actions | public | public | 0 | 0 | before_greet | def before_greet(action: IAction):print("before", action.name) | 1 | 2 | 1 | 15 | 0 | 12 | 13 | 12 | action | [] | None | {"Expr": 1} | 1 | 2 | 1 | ["print"] | 0 | [] | The function (before_greet) defined within the public class called public.The function start at line 12 and ends at 13. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called i... |
Sema4AI_actions | public | public | 0 | 0 | after_greet | def after_greet(action: IAction):print("after", action.name) | 1 | 2 | 1 | 15 | 0 | 17 | 18 | 17 | action | [] | None | {"Expr": 1} | 2 | 2 | 2 | ["print", "teardown"] | 0 | [] | The function (after_greet) defined within the public class called public.The function start at line 17 and ends at 18. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions called... |
Sema4AI_actions | public | public | 0 | 0 | my_cached_session | def my_cached_session():print("my_cached_session called")return 0 | 1 | 3 | 0 | 10 | 0 | 22 | 24 | 22 | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 3 | 1 | ["print"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_tests.test_actions.greeter.greeter_actions_py.greet"] | The function (my_cached_session) defined within the public class called public.The function start at line 22 and ends at 24. It contains 3 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 call... | |
Sema4AI_actions | public | public | 0 | 0 | my_cached_action | def my_cached_action():print("my_cached_action before")yield 1print("my_cached_action after") | 1 | 4 | 0 | 14 | 0 | 28 | 31 | 28 | [] | None | {"Expr": 3} | 2 | 4 | 2 | ["print", "print"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.actions.tests.actions_tests.test_actions.greeter.greeter_actions_py.greet"] | The function (my_cached_action) defined within the public class called public.The function start at line 28 and ends at 31. 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, It has 2.0 functions called... | |
Sema4AI_actions | public | public | 0 | 0 | greet | def greet(name: str, title="Mr.") -> str:"""Provides a greeting for a person.Args:name: The name of the person to greet.title: The title for the persor (Mr., Mrs., ...).Returns:The greeting for the person."""assert my_cached_session() == 0assert my_cached_action() == 1return f"Hello {title} {name}." | 1 | 4 | 2 | 29 | 0 | 35 | 48 | 35 | name,title | [] | str | {"Expr": 1, "Return": 1} | 2 | 14 | 2 | ["my_cached_session", "my_cached_action"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.templates.minimal.tests.test_template_py.test_actions"] | The function (greet) defined within the public class called public.The function start at line 35 and ends at 48. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [35.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions called inside ... |
Sema4AI_actions | public | public | 0 | 0 | action_python_structures | def action_python_structures(lst: list[int]) -> list[str]:return [str(item) for item in lst] | 2 | 2 | 1 | 26 | 0 | 5 | 6 | 5 | lst | [] | list[str] | {"Return": 1} | 1 | 2 | 1 | ["str"] | 0 | [] | The function (action_python_structures) defined within the public class called public.The function start at line 5 and ends at 6. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 functio... |
Sema4AI_actions | public | public | 0 | 0 | action_python_structure_response | def action_python_structure_response() -> Response[dict[str, int]]:return Response(result={"a": 1, "b": 2}) | 1 | 2 | 0 | 29 | 0 | 10 | 11 | 10 | [] | Response[dict[str, int]] | {"Return": 1} | 1 | 2 | 1 | ["Response"] | 0 | [] | The function (action_python_structure_response) defined within the public class called public.The function start at line 10 and ends at 11. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1... | |
Sema4AI_actions | public | public | 0 | 0 | action_with_table_result | def action_with_table_result() -> Table:table = Table(columns=["a", "b"], rows=[["1", "2"], ["3", "4"]])assert table.columns == ["a", "b"]for row in table.rows:assert len(row) == 2for dct in table.iter_as_dicts():assert dct["a"] in ("1", "3")assert dct["b"] in ("2", "4")return table | 3 | 9 | 0 | 91 | 1 | 5 | 15 | 5 | ['table'] | Table | {"Assign": 1, "For": 2, "Return": 1} | 3 | 11 | 3 | ["Table", "len", "table.iter_as_dicts"] | 0 | [] | The function (action_with_table_result) defined within the public class called public.The function start at line 5 and ends at 15. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 func... | |
Sema4AI_actions | public | public | 0 | 0 | action_table_in_out | def action_table_in_out(table: Table) -> Table:assert table.columns == ["a", "b"]for row in table.rows:assert len(row) == 2for dct in table.iter_as_dicts():assert dct["a"] in (1, 3)assert dct["b"] in ("2", "4")return table | 3 | 8 | 1 | 66 | 0 | 19 | 28 | 19 | table | [] | Table | {"For": 2, "Return": 1} | 2 | 10 | 2 | ["len", "table.iter_as_dicts"] | 0 | [] | The function (action_table_in_out) defined within the public class called public.The function start at line 19 and ends at 28. It contains 8 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 function... |
Sema4AI_actions | public | public | 0 | 0 | action_table_response | def action_table_response() -> Response[Table]:table = Table(columns=["a", "b"], rows=[["1", "2"], ["3", "4"]])return Response(result=table) | 1 | 3 | 0 | 44 | 1 | 32 | 35 | 32 | ['table'] | Response[Table] | {"Assign": 1, "Return": 1} | 2 | 4 | 2 | ["Table", "Response"] | 0 | [] | The function (action_table_response) defined within the public class called public.The function start at line 32 and ends at 35. 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 declares 2.0 functions, and It has 2.0 functi... | |
Sema4AI_actions | public | public | 0 | 0 | action_check_oauth2 | def action_check_oauth2(message: str,google_secret: OAuth2Secret,# Bad: cannot be unparameterized) -> str:import jsonfrom pathlib import Pathassert message == "some-message"ret = json.dumps({"access_token": google_secret.access_token,"scopes": google_secret.scopes,"provider": google_secret.provider,"metadata": google_s... | 1 | 17 | 2 | 68 | 1 | 5 | 24 | 5 | message,google_secret | ['ret'] | str | {"Assign": 1, "Expr": 1, "Return": 1} | 3 | 20 | 3 | ["json.dumps", "write_text", "Path"] | 0 | [] | The function (action_check_oauth2) defined within the public class called public.The function start at line 5 and ends at 24. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [5.0] and does not return any value. It declares 3.0 functions, and It has 3.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | action_check_oauth2 | def action_check_oauth2(message: str,google_secret: OAuth2Secret[Literal["google"],list[Literal["https://www.googleapis.com/auth/spreadsheets","https://www.googleapis.com/auth/spreadsheets.readonly",]],],) -> str:import jsonfrom pathlib import Pathassert message == "some-message"ret = json.dumps({"access_token": google... | 1 | 25 | 2 | 86 | 1 | 7 | 34 | 7 | message,google_secret | ['ret'] | str | {"Assign": 1, "Expr": 1, "Return": 1} | 3 | 28 | 3 | ["json.dumps", "write_text", "Path"] | 0 | [] | The function (action_check_oauth2) defined within the public class called public.The function start at line 7 and ends at 34. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [7.0] and does not return any value. It declares 3.0 functions, and It has 3.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | add_rows | def add_rows(header: Row = Row(cells=[])) -> Response[CustomResponse]:return Response(result=CustomResponse(ok=True, documentId="doc-id"))# type: ignore | 1 | 2 | 1 | 36 | 0 | 21 | 22 | 21 | header | [] | Response[CustomResponse] | {"Return": 1} | 4 | 2 | 4 | ["Row", "Response", "CustomResponse", "action"] | 0 | [] | The function (add_rows) defined within the public class called public.The function start at line 21 and ends at 22. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functions called in... |
Sema4AI_actions | public | public | 0 | 0 | action_with_request | def action_with_request(custom_cls: InputData, request: Request) -> str:"""Args:custom_cls: This is the input data.request:"""v = request.headers["x-custom-header"]Path(custom_cls.filename).write_text(v)return f"The result is {v}" | 1 | 4 | 2 | 36 | 1 | 17 | 25 | 17 | custom_cls,request | ['v'] | str | {"Assign": 1, "Expr": 2, "Return": 1} | 2 | 9 | 2 | ["write_text", "Path"] | 0 | [] | The function (action_with_request) defined within the public class called public.The function start at line 17 and ends at 25. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [17.0] and does not return any value. It declares 2.0 functions, and It has 2.0 funct... |
Sema4AI_actions | public | public | 0 | 0 | return_response_ok_action | def return_response_ok_action() -> Response[SomeData]:return Response(result=SomeData(show=False)) | 1 | 2 | 0 | 21 | 0 | 11 | 12 | 11 | [] | Response[SomeData] | {"Return": 1} | 2 | 2 | 2 | ["Response", "SomeData"] | 0 | [] | The function (return_response_ok_action) defined within the public class called public.The function start at line 11 and ends at 12. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 fu... | |
Sema4AI_actions | public | public | 0 | 0 | return_response_error_action | def return_response_error_action() -> Response[SomeData]:return Response(error="Something bad happened") | 1 | 2 | 0 | 16 | 0 | 16 | 17 | 16 | [] | Response[SomeData] | {"Return": 1} | 1 | 2 | 1 | ["Response"] | 0 | [] | The function (return_response_error_action) defined within the public class called public.The function start at line 16 and ends at 17. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 f... | |
Sema4AI_actions | public | public | 0 | 0 | raise_other_error_action | def raise_other_error_action() -> Response[SomeData]:raise RuntimeError("Other error") | 1 | 2 | 0 | 14 | 0 | 21 | 22 | 21 | [] | Response[SomeData] | {} | 1 | 2 | 1 | ["RuntimeError"] | 0 | [] | The function (raise_other_error_action) defined within the public class called public.The function start at line 21 and ends at 22. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 funct... | |
Sema4AI_actions | public | public | 0 | 0 | raise_action_error_action | def raise_action_error_action() -> Response[SomeData]:raise ActionError("Action error") | 1 | 2 | 0 | 14 | 0 | 26 | 27 | 26 | [] | Response[SomeData] | {} | 1 | 2 | 1 | ["ActionError"] | 0 | [] | The function (raise_action_error_action) defined within the public class called public.The function start at line 26 and ends at 27. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 func... | |
Sema4AI_actions | public | public | 0 | 0 | bad_schema | def bad_schema() -> Response[str]:return 1# type: ignore | 1 | 2 | 0 | 11 | 0 | 31 | 32 | 31 | [] | Response[str] | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (bad_schema) defined within the public class called public.The function start at line 31 and ends at 32. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. | |
Sema4AI_actions | public | public | 0 | 0 | action_with_secret | def action_with_secret(my_password: Secret) -> str:"""This is an action that requires a secret."""Path("json.output").write_text(my_password.value)return my_password.value | 1 | 3 | 1 | 25 | 0 | 7 | 12 | 7 | my_password | [] | str | {"Expr": 2, "Return": 1} | 2 | 6 | 2 | ["write_text", "Path"] | 0 | [] | The function (action_with_secret) defined within the public class called public.The function start at line 7 and ends at 12. 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 declares 2.0 functions, and It has 2.0 functions ... |
Sema4AI_actions | public | public | 0 | 0 | action_with_secret_and_request | def action_with_secret_and_request(my_password: Secret,request: Request,value: int = 0,) -> str:"""This is an action that requires a secret.Args:value: Some value."""Path("json.output").write_text(my_password.value)return my_password.value | 1 | 7 | 3 | 36 | 0 | 16 | 28 | 16 | my_password,request,value | [] | str | {"Expr": 2, "Return": 1} | 2 | 13 | 2 | ["write_text", "Path"] | 0 | [] | The function (action_with_secret_and_request) defined within the public class called public.The function start at line 16 and ends at 28. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [16.0] and does not return any value. It declares 2.0 functions, and It ha... |
Sema4AI_actions | public | public | 0 | 0 | action_with_agent_headers | def action_with_agent_headers() -> str:from sema4ai.actions.chat import _get_client_and_thread_id_client, thread_id = _get_client_and_thread_id()return f"thread_id: {thread_id}" | 1 | 4 | 0 | 24 | 0 | 5 | 9 | 5 | [] | str | {"Assign": 1, "Return": 1} | 1 | 5 | 1 | ["_get_client_and_thread_id"] | 0 | [] | The function (action_with_agent_headers) defined within the public class called public.The function start at line 5 and ends at 9. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 functi... | |
Sema4AI_actions | public | public | 0 | 0 | my_action | def my_action() -> str:"""This is the docstring"""return f"{MyClass} == {my_lib.MyClass.__name__}" | 1 | 2 | 0 | 10 | 0 | 9 | 13 | 9 | [] | str | {"Expr": 1, "Return": 1} | 0 | 5 | 0 | [] | 0 | [] | The function (my_action) defined within the public class called public.The function start at line 9 and ends at 13. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. | |
Sema4AI_actions | public | public | 0 | 0 | bad_action_no_return | def bad_action_no_return():"""Empty...""" | 1 | 1 | 0 | 5 | 0 | 5 | 8 | 5 | [] | None | {"Expr": 1} | 0 | 4 | 0 | [] | 0 | [] | The function (bad_action_no_return) defined within the public class called public.The function start at line 5 and ends at 8. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. | |
Sema4AI_actions | public | public | 0 | 0 | bad_action_no_docstring | def bad_action_no_docstring() -> str:return "" | 1 | 2 | 0 | 8 | 0 | 12 | 13 | 12 | [] | str | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (bad_action_no_docstring) defined within the public class called public.The function start at line 12 and ends at 13. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. | |
Sema4AI_actions | public | public | 0 | 0 | greet_fail_with_action_error | def greet_fail_with_action_error() -> Response[str]:"""Provides a greeting for a person.Returns:The greeting for the person."""from sema4ai.actions import ActionErrorraise ActionError("Sorry, this must fail.") | 1 | 3 | 0 | 21 | 0 | 5 | 14 | 5 | [] | Response[str] | {"Expr": 1} | 1 | 10 | 1 | ["ActionError"] | 0 | [] | The function (greet_fail_with_action_error) defined within the public class called public.The function start at line 5 and ends at 14. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 fu... | |
Sema4AI_actions | public | public | 0 | 0 | my_action | def my_action():pass | 1 | 2 | 0 | 5 | 0 | 7 | 8 | 7 | [] | None | {} | 0 | 2 | 0 | [] | 0 | [] | The function (my_action) defined within the public class called public.The function start at line 7 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. | |
Sema4AI_actions | public | public | 0 | 0 | build_executable_with_pyinstaller | def build_executable_with_pyinstaller(root_dir: Path,debug: bool,ci: bool,onefile: bool,name: str,dist_path: str,spec_name: str,) -> None:"""Builds the executable via PyInstaller. Expects the spec_name to be in the cwd."""import sysfrom .process_call import runspec_file = root_dir / spec_nameif not spec_file.exists():r... | 6 | 31 | 7 | 155 | 4 | 4 | 38 | 4 | root_dir,debug,ci,onefile,name,dist_path,spec_name | ['spec_args', 'args', 'spec_file', 'ci'] | None | {"Assign": 4, "Expr": 11, "If": 5} | 12 | 35 | 12 | ["spec_file.exists", "FileNotFoundError", "spec_args.append", "args.append", "args.append", "spec_args.append", "args.append", "spec_args.append", "args.append", "args.append", "args.extend", "run"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (build_executable_with_pyinstaller) defined within the public class called public.The function start at line 4 and ends at 38. It contains 31 lines of code and it has a cyclomatic complexity of 6. It takes 7 parameters, represented as [4.0] and does not return any value. It declares 12.0 functions, It has ... |
Sema4AI_actions | public | public | 0 | 0 | make_executable | def make_executable(target_executable: Path) -> None:"""Make the executable executable."""target_executable.chmod(0o755) | 1 | 2 | 1 | 16 | 0 | 41 | 45 | 41 | target_executable | [] | None | {"Expr": 2} | 1 | 5 | 1 | ["target_executable.chmod"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (make_executable) defined within the public class called public.The function start at line 41 and ends at 45. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called ins... |
Sema4AI_actions | public | public | 0 | 0 | make_entitlements_file | def make_entitlements_file(target_dir: Path) -> Path:"""Creates an entitlements file in the target directory."""contents = """<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.cs.... | 1 | 17 | 1 | 26 | 2 | 4 | 23 | 4 | target_dir | ['entitlements_path', 'contents'] | Path | {"Assign": 2, "Expr": 2, "Return": 1} | 1 | 20 | 1 | ["entitlements_path.write_text"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (make_entitlements_file) defined within the public class called public.The function start at line 4 and ends at 23. 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 declare 1.0 function, It has 1.0 function cal... |
Sema4AI_actions | public | public | 0 | 0 | make_file_with_function_contents | def make_file_with_function_contents(func, target: Path) -> Path:name = func.__name__print(f"Creating file {target} with function contents of: {name}")source_lines, _ = inspect.getsourcelines(func)# First, find the "def" line.def_lineno = 0for line in source_lines:line = line.strip()if line.startswith("def") and line.e... | 8 | 22 | 2 | 148 | 6 | 5 | 37 | 5 | func,target | ['line', 'source', 'indent', 'source_lines', 'name', 'def_lineno'] | Path | {"Assign": 8, "AugAssign": 1, "Expr": 2, "For": 2, "If": 2, "Return": 1} | 13 | 33 | 13 | ["print", "inspect.getsourcelines", "line.strip", "line.startswith", "line.endswith", "ValueError", "line.strip", "len", "len", "line.lstrip", "line.strip", "join", "target.write_text"] | 0 | [] | The function (make_file_with_function_contents) defined within the public class called public.The function start at line 5 and ends at 37. It contains 22 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [5.0] and does not return any value. It declares 13.0 functions, and It ... |
Sema4AI_actions | public | public | 0 | 0 | run | def run(cmd: Sequence[str], cwd=None, shell=False, env: dict | None = None) -> None:import shlexprint(cmd)print("Calling: ",subprocess.list2cmdline(cmd) if sys.platform == "win32" else shlex.join(cmd),)subprocess.check_call(cmd, cwd=cwd, shell=shell, env=env) | 2 | 8 | 4 | 77 | 0 | 6 | 14 | 6 | cmd,cwd,shell,env | [] | None | {"Expr": 3} | 5 | 9 | 5 | ["print", "print", "subprocess.list2cmdline", "shlex.join", "subprocess.check_call"] | 596 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.app.handlers.package_versions_py.PackageVersions.index", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3511986_dart_archive_pub_dartlang.third_party.cherrypy.test.benchmark_py.run_m... | The function (run) defined within the public class called public.The function start at line 6 and ends at 14. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [6.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions called inside whic... |
Sema4AI_actions | public | public | 0 | 0 | run_and_capture_output | def run_and_capture_output(cmd: Sequence[str], cwd=None, shell=False, env: dict | None = None) -> tuple[str, str]:import shlexprint(cmd)print("Calling (capturing output): ",subprocess.list2cmdline(cmd) if sys.platform == "win32" else shlex.join(cmd),)try:result = subprocess.run(cmd,cwd=cwd,shell=shell,capture_output=Tr... | 3 | 26 | 4 | 126 | 1 | 17 | 43 | 17 | cmd,cwd,shell,env | ['result'] | tuple[str, str] | {"Assign": 1, "Expr": 2, "Return": 1, "Try": 1} | 6 | 27 | 6 | ["print", "print", "subprocess.list2cmdline", "shlex.join", "subprocess.run", "Exception"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.signing_py._sign_macos_executable", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflo... | The function (run_and_capture_output) defined within the public class called public.The function start at line 17 and ends at 43. It contains 26 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [17.0] and does not return any value. It declares 6.0 functions, It has 6.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | get_root_dir | def get_root_dir() -> Path:"""Get the root directory of the project."""import os.path# The root directory is the directory containing pyproject.tomlinitial_dir = curdir = Path(os.path.abspath(os.path.normpath(".")))while not (curdir / "pyproject.toml").exists():parent_dir = curdir.parentif parent_dir == curdir or not p... | 4 | 11 | 0 | 69 | 3 | 4 | 19 | 4 | ['parent_dir', 'initial_dir', 'curdir'] | Path | {"Assign": 3, "Expr": 1, "If": 1, "Return": 1, "While": 1} | 5 | 16 | 5 | ["Path", "os.path.abspath", "os.path.normpath", "exists", "RuntimeError"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tasks_py.build_executable", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tasks_py.clean", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_C... | The function (get_root_dir) defined within the public class called public.The function start at line 4 and ends at 19. It contains 11 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 5.0 functions, It has 5.0 functions called ins... | |
Sema4AI_actions | public | public | 0 | 0 | setup_keychain | def setup_keychain(cert: Optional[str] = None,password: Optional[str] = None,keychain_name: str = "build.keychain",) -> None:"""Sets up the keychain for macOS code signing.This should be run before building if code signing is needed."""import base64import osimport sysfrom .process_call import runif sys.platform != "dar... | 9 | 50 | 3 | 243 | 3 | 9 | 73 | 9 | cert,password,keychain_name | ['cert_path', 'signing_cert', 'signing_password'] | None | {"Assign": 3, "Expr": 11, "If": 3, "Return": 1, "Try": 3} | 18 | 65 | 18 | ["os.environ.get", "os.environ.get", "KeychainSetupError", "KeychainSetupError", "run", "run", "run", "Path", "cert_path.write_bytes", "base64.b64decode", "run", "str", "run", "cert_path.unlink", "print", "run", "print", "KeychainSetupError"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (setup_keychain) defined within the public class called public.The function start at line 9 and ends at 73. It contains 50 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [9.0] and does not return any value. It declares 18.0 functions, It has 18.0 functions call... |
Sema4AI_actions | public | public | 0 | 0 | sign_macos_executable | def sign_macos_executable(root_dir: Path, target_executable: Path) -> None:max_attempts = 3for i in range(max_attempts):try:_sign_macos_executable(root_dir, target_executable)breakexcept Exception as e:print(f"Error signing executable: {e}")if i == max_attempts - 1:raise RuntimeError("Failed to sign executable after 3 ... | 4 | 10 | 2 | 57 | 1 | 76 | 85 | 76 | root_dir,target_executable | ['max_attempts'] | None | {"Assign": 1, "Expr": 2, "For": 1, "If": 1, "Try": 1} | 4 | 10 | 4 | ["range", "_sign_macos_executable", "print", "RuntimeError"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (sign_macos_executable) defined within the public class called public.The function start at line 76 and ends at 85. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [76.0] and does not return any value. It declares 4.0 functions, It has 4.0 functio... |
Sema4AI_actions | public | public | 0 | 0 | _sign_macos_executable | def _sign_macos_executable(root_dir: Path, target_executable: Path) -> None:"""Sign the macOS executable."""from .process_call import run, run_and_capture_output# Sign the binary with the certificateprint("Signing binary...")assert Path("entitlements.mac.plist").exists(), f"Entitlements file not found in expected place... | 2 | 76 | 2 | 315 | 1 | 88 | 185 | 88 | root_dir,target_executable | ['temp_zip'] | None | {"Assign": 6, "Expr": 22, "If": 1, "With": 1} | 42 | 98 | 42 | ["print", "exists", "Path", "absolute", "Path", "print", "run_and_capture_output", "get_from_env", "str", "print", "print", "print", "print", "run_and_capture_output", "str", "print", "print", "print", "run_and_capture_output", "str", "print", "print", "print", "Path", "zipfile.ZipFile", "zf.write", "print", "run_and_c... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.signing_py.sign_macos_executable"] | The function (_sign_macos_executable) defined within the public class called public.The function start at line 88 and ends at 185. It contains 76 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [88.0] and does not return any value. It declares 42.0 functions, It has 42.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | get_from_env | def get_from_env(key: str) -> str:import osvalue = os.environ.get(key)if not value:raise ValueError(f"Environment variable {key} is not set")return value | 2 | 6 | 1 | 33 | 1 | 188 | 194 | 188 | key | ['value'] | str | {"Assign": 1, "If": 1, "Return": 1} | 2 | 7 | 2 | ["os.environ.get", "ValueError"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.signing_py._sign_macos_executable", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.signing... | The function (get_from_env) defined within the public class called public.The function start at line 188 and ends at 194. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called i... |
Sema4AI_actions | public | public | 0 | 0 | sign_windows_executable | def sign_windows_executable(target_executable: Path) -> None:max_attempts = 3for i in range(max_attempts):try:_sign_windows_executable(target_executable)breakexcept Exception as e:print(f"Error signing executable: {e}")if i == max_attempts - 1:raise RuntimeError("Failed to sign executable after 3 attempts") from e | 4 | 10 | 1 | 51 | 1 | 197 | 206 | 197 | target_executable | ['max_attempts'] | None | {"Assign": 1, "Expr": 2, "For": 1, "If": 1, "Try": 1} | 4 | 10 | 4 | ["range", "_sign_windows_executable", "print", "RuntimeError"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (sign_windows_executable) defined within the public class called public.The function start at line 197 and ends at 206. It contains 10 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | _sign_windows_executable | def _sign_windows_executable(target_executable: Path) -> None:"""Sign the Windows executable."""from .process_call import runglobal installed_azure_sign_tool# Install AzureSignTool if not already installedif not installed_azure_sign_tool:run(["dotnet","tool","install","--global","AzureSignTool","--version","3.0.0",])in... | 4 | 49 | 1 | 158 | 9 | 212 | 272 | 212 | target_executable | ['installed_azure_sign_tool', 'run_in_powershell', 'certificate_name', 'tenant_id', 'client_secret', 'cmd', 'vault_url', 'ps_command', 'client_id'] | None | {"Assign": 9, "Expr": 3, "If": 1} | 9 | 61 | 9 | ["run", "get_from_env", "get_from_env", "get_from_env", "get_from_env", "get_from_env", "str", "join", "run"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.signing_py.sign_windows_executable"] | The function (_sign_windows_executable) defined within the public class called public.The function start at line 212 and ends at 272. It contains 49 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 9.0 functions, It has 9.0 funct... |
Sema4AI_actions | public | public | 0 | 0 | make_error_message | def make_error_message(message: str) -> str:return f"""Error: {message}.Please set up the GitHub Actions environment variables in the failing step in the following format (to collect the version):- GITHUB_EVENT_NAME: ${{ github.event_name }}- GITHUB_REF_NAME: ${{ github.ref_name }}- GITHUB_PR_NUMBER: ${{ github.event.p... | 1 | 1 | 1 | 12 | 0 | 4 | 10 | 4 | message | [] | str | {"Return": 1} | 0 | 7 | 0 | [] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.version_from_github_actions_py.get_release_channel_from_github_actions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_co... | The function (make_error_message) defined within the public class called public.The function start at line 4 and ends at 10. It contains 1 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 has 2.0 functions calling this function which are ... |
Sema4AI_actions | public | public | 0 | 0 | get_version_from_github_actions | def get_version_from_github_actions() -> str:"""Get the version and release channel from the GitHub Actions environment variables.# Original logic:# version: >-# ${{# github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) ||# github.event_name == 'push' && startsWith(github.ref, 'refs... | 7 | 20 | 0 | 117 | 4 | 13 | 57 | 13 | ['pr_number', 'event_name', 'ref_name', 'version'] | str | {"Assign": 5, "Expr": 1, "If": 6, "Return": 1} | 11 | 45 | 11 | ["os.environ.get", "os.environ.get", "os.environ.get", "is_in_github_actions", "RuntimeError", "ValueError", "make_error_message", "ValueError", "make_error_message", "ValueError", "make_error_message"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (get_version_from_github_actions) defined within the public class called public.The function start at line 13 and ends at 57. It contains 20 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters and does not return any value. It declares 11.0 functions, It has 11.... | |
Sema4AI_actions | public | public | 0 | 0 | get_release_channel_from_github_actions | def get_release_channel_from_github_actions() -> str:from sema4ai.build_common.workflows import is_in_github_actionsevent_name = os.environ.get("GITHUB_EVENT_NAME", "")ref_name = os.environ.get("GITHUB_REF_NAME", "")if not event_name:if not is_in_github_actions():raise RuntimeError("Unable to automatically determine a ... | 6 | 19 | 0 | 96 | 3 | 60 | 83 | 60 | ['event_name', 'ref_name', 'release_channel'] | str | {"Assign": 5, "If": 5, "Return": 1} | 8 | 24 | 8 | ["os.environ.get", "os.environ.get", "is_in_github_actions", "RuntimeError", "ValueError", "make_error_message", "ValueError", "make_error_message"] | 0 | [] | The function (get_release_channel_from_github_actions) defined within the public class called public.The function start at line 60 and ends at 83. It contains 19 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 8.0 functions, and... | |
Sema4AI_actions | public | public | 0 | 0 | make_executable | def make_executable(target_executable: Path) -> None:"""Make the executable executable."""target_executable.chmod(0o755) | 1 | 2 | 1 | 16 | 0 | 4 | 8 | 4 | target_executable | [] | None | {"Expr": 2} | 1 | 5 | 1 | ["target_executable.chmod"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (make_executable) defined within the public class called public.The function start at line 4 and ends at 8. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called insid... |
Sema4AI_actions | public | public | 0 | 0 | clean_common_build_artifacts | def clean_common_build_artifacts(root_dir: Path):"""Clean common build artifacts."""import shutildist_dir = root_dir / "dist"build_dir = root_dir / "build"entitlements_file = root_dir / "entitlements.mac.plist"assets_zip = root_dir / "go-wrapper" / "assets" / "assets.zip"zip_hash = root_dir / "go-wrapper" / "assets" / ... | 5 | 24 | 1 | 137 | 7 | 11 | 38 | 11 | root_dir | ['assets_zip', 'dist_dir', 'paths_to_delete', 'entitlements_file', 'assets_version', 'zip_hash', 'build_dir'] | None | {"Assign": 7, "Expr": 5, "For": 1, "If": 3} | 5 | 28 | 5 | ["path.exists", "print", "shutil.rmtree", "print", "path.unlink"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tasks_py.clean"] | The function (clean_common_build_artifacts) defined within the public class called public.The function start at line 11 and ends at 38. It contains 24 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 5.0 functions, It has 5.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | is_in_github_actions | def is_in_github_actions() -> bool:"""Check if we are in GitHub Actions."""import osreturn os.environ.get("GITHUB_ACTIONS") == "true" | 1 | 3 | 0 | 20 | 0 | 41 | 45 | 41 | [] | bool | {"Expr": 1, "Return": 1} | 1 | 5 | 1 | ["os.environ.get"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.version_from_github_actions_py.get_release_channel_from_github_actions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_co... | The function (is_in_github_actions) defined within the public class called public.The function start at line 41 and ends at 45. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function calle... | |
Sema4AI_actions | public | public | 0 | 0 | build_and_sign_executable | def build_and_sign_executable(*,root_dir: Path,name: str,debug: bool,ci: bool,dist_path: Path,sign: bool,go_wrapper: bool,version: str | None = None,go_wrapper_name: str | None = None,):"""Default workflow to build and sign the executable.Args:root_dir: Root directory of the project.name: Name of the project (e.g. sai-... | 21 | 133 | 9 | 647 | 14 | 48 | 221 | 48 | root_dir,name,debug,ci,dist_path,sign,go_wrapper,version,go_wrapper_name | ['executable_name', 'go_wrapper_name', 'go_executable', 'spec_name', 'target_executable', 'assets_dir', 'app_dir_inside_dist_dir', 'onefile', 'entitlements_path', 'version', 'go_wrapper_executable_name', 'final_executable', 'go_wrapper_dir', 'built_go_wrapper'] | None | {"Assign": 17, "Expr": 34, "If": 14} | 51 | 174 | 51 | ["make_entitlements_file", "print", "entitlements_path.absolute", "name.endswith", "go_wrapper_dir.exists", "go_wrapper_dir.is_dir", "print", "shutil.which", "run_and_capture_output", "print", "print", "print", "print", "get_version_from_github_actions", "is_in_github_actions", "print", "print", "print", "setup_keychai... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tasks_py.build_executable"] | The function (build_and_sign_executable) defined within the public class called public.The function start at line 48 and ends at 221. It contains 133 lines of code and it has a cyclomatic complexity of 21. It takes 9 parameters, represented as [48.0] and does not return any value. It declares 51.0 functions, It has 51.... |
Sema4AI_actions | public | public | 0 | 0 | zip_go_wrapper_assets | def zip_go_wrapper_assets(src_path: Path, assets_dir: Path):"""Get the assets from the build-binary and zip them up.Args:src_path: The path to the directory containing the assets (dist/<project-name>)assets_dir: The path to the directory to save the zip file(usually ROOT_DIR / "go-wrapper" / "assets")"""import hashlibi... | 5 | 18 | 2 | 135 | 3 | 4 | 34 | 4 | src_path,assets_dir | ['zip_path', 'zip_hash', 'zip_hash_file'] | None | {"Assign": 3, "Expr": 7, "For": 1, "If": 3, "With": 1} | 16 | 31 | 16 | ["src_path.exists", "RuntimeError", "zip_path.exists", "zip_path.unlink", "print", "zipfile.ZipFile", "src_path.rglob", "file.is_file", "zf.write", "file.relative_to", "print", "hexdigest", "hashlib.sha256", "zip_path.read_bytes", "zip_hash_file.write_text", "print"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (zip_go_wrapper_assets) defined within the public class called public.The function start at line 4 and ends at 34. It contains 18 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [4.0] and does not return any value. It declares 16.0 functions, It has 16.0 functio... |
Sema4AI_actions | public | public | 0 | 0 | write_version_to_go_wrapper | def write_version_to_go_wrapper(assets_dir: Path, version: str):"""Write the version to the go-wrapper/version.txt file."""v_file = assets_dir / "version.txt"v_file.write_text(version)print(f"Wrote version {version} to {v_file}") | 1 | 4 | 2 | 28 | 1 | 37 | 43 | 37 | assets_dir,version | ['v_file'] | None | {"Assign": 1, "Expr": 3} | 2 | 7 | 2 | ["v_file.write_text", "print"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.build_common.src.sema4ai.build_common.workflows_py.build_and_sign_executable"] | The function (write_version_to_go_wrapper) defined within the public class called public.The function start at line 37 and ends at 43. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [37.0] and does not return any value. It declares 2.0 functions, It has 2.0 fu... |
Sema4AI_actions | public | public | 0 | 0 | obtain_app_mutex | def obtain_app_mutex(*,kill_lock_holder: bool = False,data_dir: Path,lock_basename: str,app_name: str,timeout: int = 10,mutex_creation_kwargs: dict[str, Any] | None = None,) -> "SystemMutex | None":"""This function is used to obtain a mutex for the application.If the mutex is already acquired by another process, the cu... | 14 | 63 | 6 | 295 | 10 | 12 | 122 | 12 | kill_lock_holder,data_dir,lock_basename,app_name,timeout,mutex_creation_kwargs | ['acquired', 'matched', 'timeout_at', 'pid', 'i', 'found', 'shown_first_message', 'timed_out', 'mutex', 'msg'] | 'SystemMutex | None' | {"Assign": 13, "Expr": 9, "If": 9, "Return": 2, "Try": 1, "While": 1} | 21 | 111 | 21 | ["time.monotonic", "SystemMutex", "str", "mutex.get_mutex_aquired", "log.info", "msg.find", "msg.strip", "re.search", "msg.splitlines", "matched.group", "int", "RuntimeError", "log.info", "is_process_alive", "log.info", "kill_process_and_subprocesses", "log.info", "log.info", "time.sleep", "time.monotonic", "log.critic... | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._command_requiring_datadir", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.common.tests.sema4ai_common_tests.tes... | The function (obtain_app_mutex) defined within the public class called public.The function start at line 12 and ends at 122. It contains 63 lines of code and it has a cyclomatic complexity of 14. It takes 6 parameters, represented as [12.0] and does not return any value. It declares 21.0 functions, It has 21.0 function... |
Sema4AI_actions | public | public | 0 | 0 | exit_when_pid_exits.watch_parent_process | def watch_parent_process():# exit when any of the ids we're tracking exit.log.debug("Watching for parent process to exit")while True:try:for pid in tuple(_track_pids_to_exit):if not is_process_alive(pid):# Note: just exit since the parent process already# exited.log.info(f"Force-quit process: {os.getpid()} because pare... | 5 | 13 | 0 | 61 | 0 | 36 | 52 | 36 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (exit_when_pid_exits.watch_parent_process) defined within the public class called public.The function start at line 36 and ends at 52. It contains 13 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value.. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.