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 | _run_action_impl.on_cancel | def on_cancel(*args, **kwargs):log.info(f"Killing process related to run {run.id} due to cancel request (pid: {process_handle.pid}).")process_handle.kill() | 1 | 5 | 2 | 21 | 0 | 452 | 456 | 452 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_run_action_impl.on_cancel) defined within the public class called public.The function start at line 452 and ends at 456. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [452.0] and does not return any value.. |
Sema4AI_actions | _ActionsRunner | protected | 0 | 0 | _run_action_impl | def _run_action_impl(self) -> Any:from concurrent.futures import CancelledErrorfrom typing import Literalfrom sema4ai.action_server._actions_process_pool import (ActionsProcessPool,ProcessHandle,)from sema4ai.action_server._runs_state_cache import get_global_runs_stateaction_package: "ActionPackage" = self.action_packa... | 17 | 137 | 1 | 589 | 0 | 385 | 557 | 385 | self | [] | Any | {"AnnAssign": 11, "Assign": 22, "Expr": 12, "If": 9, "Return": 2, "Try": 5, "With": 3} | 45 | 173 | 45 | ["get_settings", "get_global_runs_state", "global_runs_state.create_run_runtime_info", "get_db", "db.connect", "get_actions_process_pool", "time.monotonic", "actions_process_pool.obtain_process_for_action", "time.monotonic", "input_json.write_bytes", "encode", "json.dumps", "_set_run_as_running", "log.info", "process_h... | 0 | [] | The function (_run_action_impl) defined within the protected class called _ActionsRunner.The function start at line 385 and ends at 557. It contains 137 lines of code and it has a cyclomatic complexity of 17. The function does not take any parameters and does not return any value. It declares 45.0 functions, and It ha... |
Sema4AI_actions | public | public | 0 | 0 | _name_as_class_name | def _name_as_class_name(name):return name.replace("_", " ").title().replace(" ", "") | 1 | 2 | 1 | 25 | 0 | 560 | 561 | 560 | name | [] | Returns | {"Return": 1} | 3 | 2 | 3 | ["replace", "title", "name.replace"] | 0 | [] | The function (_name_as_class_name) defined within the public class called public.The function start at line 560 and ends at 561. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0 fu... |
Sema4AI_actions | public | public | 0 | 0 | generate_func_from_action | def generate_func_from_action(action_package: "ActionPackage", action: "Action", display_name: str) -> Tuple[Callable[[Response, Request], Any],IInternalFuncAPI,dict[str, object], | 1 | 6 | 3 | 37 | 0 | 564 | 569 | 564 | action_package,action,display_name | [] | Tuple[Callable[[Response, Request], Any], IInternalFuncAPI, dict[str, object]] | {"Assign": 14, "Expr": 3, "If": 3, "Return": 3, "Try": 3} | 22 | 140 | 22 | ["json.loads", "json.loads", "_get_json_validator", "RuntimeError", "_get_json_validator", "RuntimeError", "request.body", "json.loads", "RequestValidationError", "dict", "lower", "request.headers.items", "dict", "ResponseHandler", "headers.get", "isinstance", "RequestValidationError", "inputs.pop", "headers.update", "... | 0 | [] | The function (generate_func_from_action) defined within the public class called public.The function start at line 564 and ends at 569. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [564.0] and does not return any value. It declares 22.0 functions, and It has... |
Sema4AI_actions | public | public | 0 | 0 | func_fast_api | async def func_fast_api(response: Response, request: Request):body = await request.body()try:inputs = json.loads(body)except Exception as e:raise RequestValidationError([f"The received input arguments (sent in the body) cannot be interpreted as json. Details: {e}"])headers = dict((x[0].lower(), x[1]) for x in request.h... | 6 | 26 | 2 | 147 | 0 | 634 | 672 | 634 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (func_fast_api) defined within the public class called public.The function start at line 634 and ends at 672. It contains 26 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [634.0] and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | func_internal | async def func_internal(response_handler: IResponseHandler, inputs: Any, headers: dict, cookies: dict) -> Any:"""This is an internal function that actually runs an action (in the threadpool) based on the user's inputs.Args:response_handler: The response handler to use (where we can set the run id and whether an async c... | 1 | 16 | 4 | 55 | 0 | 674 | 701 | 674 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (func_internal) defined within the public class called public.The function start at line 674 and ends at 701. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [674.0] and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | _iter_jsonschema_specifications | def _iter_jsonschema_specifications():from pathlib import Pathimport jsonschema_specifications# type: ignorefrom referencing import Resourceparent = Path(jsonschema_specifications._core.__file__).absolute().parentfor version in (parent / "schemas").iterdir():if version.name.startswith("."):continuefor child in version.... | 7 | 15 | 0 | 118 | 3 | 706 | 723 | 706 | ['parent', 'children', 'contents'] | None | {"Assign": 3, "Expr": 1, "For": 3, "If": 2} | 11 | 18 | 11 | ["absolute", "Path", "iterdir", "version.name.startswith", "version.iterdir", "child.is_file", "child.iterdir", "path.name.startswith", "json.loads", "path.read_text", "Resource.from_contents"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_run_py._fix_jsonschema_specifications"] | The function (_iter_jsonschema_specifications) defined within the public class called public.The function start at line 706 and ends at 723. It contains 15 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 1... | |
Sema4AI_actions | public | public | 0 | 0 | _fix_jsonschema_specifications | def _fix_jsonschema_specifications():import jsonschema_specifications# type: ignorefrom referencing.jsonschema import EMPTY_REGISTRY as _EMPTY_REGISTRYREGISTRY = (_iter_jsonschema_specifications() @ _EMPTY_REGISTRY).crawl()jsonschema_specifications.REGISTRY = REGISTRY | 1 | 5 | 0 | 32 | 1 | 726 | 731 | 726 | ['REGISTRY'] | None | {"Assign": 2} | 2 | 6 | 2 | ["crawl", "_iter_jsonschema_specifications"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_run_py._get_json_validator"] | The function (_fix_jsonschema_specifications) defined within the public class called public.The function start at line 726 and ends at 731. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 ... | |
Sema4AI_actions | public | public | 0 | 0 | _get_json_validator | def _get_json_validator(schema: dict):# Dirty hack to make jsonschema_specifications work with pyoxidizer.# see: https://github.com/python-jsonschema/jsonschema-specifications/issues/61_fix_jsonschema_specifications()from jsonschema.validators import validator_forcls = validator_for(schema)cls.check_schema(schema)insta... | 1 | 7 | 1 | 38 | 2 | 734 | 744 | 734 | schema | ['instance', 'cls'] | Returns | {"Assign": 2, "Expr": 2, "Return": 1} | 4 | 11 | 4 | ["_fix_jsonschema_specifications", "validator_for", "cls.check_schema", "cls"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_run_py.generate_func_from_action"] | The function (_get_json_validator) defined within the public class called public.The function start at line 734 and ends at 744. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 4.0 functions, It has 4.0 functio... |
Sema4AI_actions | public | public | 0 | 0 | _add_preload_actions_dir_to_env_pythonpath | def _add_preload_actions_dir_to_env_pythonpath(env: Dict[str, str]) -> None:from sema4ai.action_server import _preload_actionsp = Path(_preload_actions.__file__)if "__init__" in p.name:p = p.parentcurr_pythonpath = env.get("PYTHONPATH", "")if not curr_pythonpath:env["PYTHONPATH"] = str(p)else:env["PYTHONPATH"] = f"{p}{... | 3 | 10 | 1 | 72 | 2 | 11 | 21 | 11 | env | ['p', 'curr_pythonpath'] | None | {"Assign": 5, "If": 2} | 3 | 11 | 3 | ["Path", "env.get", "str"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_process_pool_py.ProcessHandle.__init__"] | The function (_add_preload_actions_dir_to_env_pythonpath) defined within the public class called public.The function start at line 11 and ends at 21. It contains 10 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, ... |
Sema4AI_actions | public | public | 0 | 0 | get_action_package_cwd | def get_action_package_cwd(settings: "Settings", action_package: "ActionPackage") -> Path:directory = Path(action_package.directory)# Make it absolute now!if not directory.is_absolute():directory = (settings.datadir / directory).absolute()if not directory.exists():raise RuntimeError(f"""Error. Unable to run because act... | 3 | 10 | 2 | 58 | 1 | 24 | 43 | 24 | settings,action_package | ['directory'] | Path | {"Assign": 2, "If": 2, "Return": 1} | 5 | 20 | 5 | ["Path", "directory.is_absolute", "absolute", "directory.exists", "RuntimeError"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_process_pool_py.ProcessHandle.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.act... | The function (get_action_package_cwd) defined within the public class called public.The function start at line 24 and ends at 43. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [24.0] and does not return any value. It declares 5.0 functions, It has 5.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | list_action_packages | def list_action_packages():from sema4ai.action_server._models import get_dbdb = get_db()with db.connect():# We're running in the threadpool used by fast api, so, we need# to make a new connection (maybe it'd make sense to create a# connection pool instead of always creating a new connection...).action_packages = db.all... | 3 | 13 | 0 | 93 | 3 | 19 | 38 | 19 | ['action_packages', 'db', 'id_to_action_package'] | Returns | {"Assign": 4, "Expr": 1, "For": 2, "Return": 1, "With": 1} | 9 | 20 | 9 | ["get_db", "db.connect", "db.all", "ActionPackageApi", "db.all", "actions.append", "list", "id_to_action_package.values", "action_package_api_router.get"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._server_websockets_py._list_actions_in_threadpool"] | The function (list_action_packages) defined within the public class called public.The function start at line 19 and ends at 38. It contains 13 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 9.0 functions, It has 9.0 functio... | |
Sema4AI_actions | public | public | 0 | 0 | _make_name_user_friendly | def _make_name_user_friendly(name: str) -> str:return name.replace("_", " ").title() | 1 | 2 | 1 | 22 | 0 | 14 | 15 | 14 | name | [] | str | {"Return": 1} | 2 | 2 | 2 | ["title", "name.replace"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_action_routes_py._ActionRoutes.register_actions"] | The function (_make_name_user_friendly) defined within the public class called public.The function start at line 14 and ends at 15. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 function... |
Sema4AI_actions | public | public | 0 | 0 | _name_to_url | def _name_to_url(name: str) -> str:from sema4ai.action_server._slugify import slugifyreturn slugify(name.replace("_", "-")) | 1 | 3 | 1 | 29 | 0 | 18 | 21 | 18 | name | [] | str | {"Return": 1} | 2 | 4 | 2 | ["slugify", "name.replace"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_action_routes_py.build_url_api_run"] | The function (_name_to_url) defined within the public class called public.The function start at line 18 and ends at 21. 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, It has 2.0 functions called ins... |
Sema4AI_actions | public | public | 0 | 0 | build_url_api_run | def build_url_api_run(action_package_name: str, action_name: str) -> str:return f"/api/actions/{_name_to_url(action_package_name)}/{_name_to_url(action_name)}/run" | 1 | 2 | 2 | 16 | 0 | 24 | 25 | 24 | action_package_name,action_name | [] | str | {"Return": 1} | 2 | 2 | 2 | ["_name_to_url", "_name_to_url"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_action_routes_py._ActionRoutes.register_actions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4a... | The function (build_url_api_run) defined within the public class called public.The function start at line 24 and ends at 25. It contains 2 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, It has 2.0 functions ca... |
Sema4AI_actions | public | public | 0 | 0 | get_action_description_from_docs | def get_action_description_from_docs(docs: str) -> str:import docstring_parserdoc_desc: strtry:parsed = docstring_parser.parse(docs)if parsed.short_description and parsed.long_description:doc_desc = f"{parsed.short_description}\n{parsed.long_description}"else:doc_desc = parsed.long_description or parsed.short_descripti... | 7 | 13 | 1 | 71 | 2 | 28 | 41 | 28 | docs | ['doc_desc', 'parsed'] | str | {"AnnAssign": 1, "Assign": 4, "Expr": 1, "If": 1, "Return": 1, "Try": 1} | 3 | 14 | 3 | ["docstring_parser.parse", "log.exception", "str"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_action_routes_py._ActionRoutes.register_actions", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.acti... | The function (get_action_description_from_docs) defined within the public class called public.The function start at line 28 and ends at 41. It contains 13 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 3.0 functions, It has 3.0... |
Sema4AI_actions | APIKeyAuthBackend | public | 0 | 1 | __init__ | def __init__(self,api_key: str,):self.api_key = api_key | 1 | 5 | 2 | 15 | 0 | 49 | 53 | 49 | self,api_key | [] | None | {"Assign": 1} | 0 | 5 | 0 | [] | 6,243 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec... | The function (__init__) defined within the public class called APIKeyAuthBackend, that inherit another class.The function start at line 49 and ends at 53. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [49.0] and does not return any value. It has 6243.0 functi... |
Sema4AI_actions | APIKeyAuthBackend | public | 0 | 1 | authenticate | async def authenticate(self, conn: HTTPConnection) -> tuple[AuthCredentials, BaseUser] | None:from starlette.authentication import SimpleUserfrom starlette.exceptions import HTTPExceptionfrom starlette.status import HTTP_403_FORBIDDENauth_header = next((conn.headers.get(key)for key in conn.headersif key.lower() == "aut... | 6 | 25 | 2 | 132 | 0 | 55 | 84 | 55 | self,conn | [] | tuple[AuthCredentials, BaseUser] | None | {"Assign": 2, "If": 2, "Return": 1} | 9 | 30 | 9 | ["next", "conn.headers.get", "key.lower", "startswith", "auth_header.lower", "HTTPException", "HTTPException", "AuthCredentials", "SimpleUser"] | 87 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3682791_mattupstate_flask_security.tests.test_changeable_py.test_custom_change_template", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3682791_mattupstate_flask_security.tests.test_changeable_py.test_custom_change_... | The function (authenticate) defined within the public class called APIKeyAuthBackend, that inherit another class.The function start at line 55 and ends at 84. It contains 25 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [55.0] and does not return any value. It declares 9.0... |
Sema4AI_actions | APIKeyAuthBackend | public | 0 | 1 | __init__ | def __init__(self,whitelist: str | None,endpoint_dependencies: list[params.Depends],):"""Args:whitelist: The whitelist of actions to register.endpoint_dependencies: The dependencies for the endpoint (which will require the API key).api_key: The API key to use for the endpoint."""from mcp.server.sse import SseServerTran... | 1 | 19 | 3 | 134 | 0 | 88 | 114 | 88 | self,api_key | [] | None | {"Assign": 1} | 0 | 5 | 0 | [] | 6,243 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec... | The function (__init__) defined within the public class called APIKeyAuthBackend, that inherit another class.The function start at line 88 and ends at 114. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [88.0] and does not return any value. It has 6243.0 func... |
Sema4AI_actions | _ActionRoutes | protected | 0 | 0 | setup_mcp_server | def setup_mcp_server(self, api_key: str | None) -> None:"""Setup the MCP server with both streamable HTTP and SSE support."""from starlette.middleware.authentication import AuthenticationMiddlewarefrom sema4ai.action_server._app import get_appapp = get_app()middleware: list[Middleware] = []if api_key:middleware.append(... | 2 | 14 | 2 | 82 | 0 | 116 | 136 | 116 | self,api_key | [] | None | {"AnnAssign": 1, "Assign": 1, "Expr": 4, "If": 1} | 6 | 21 | 6 | ["get_app", "middleware.append", "Middleware", "APIKeyAuthBackend", "self._setup_mcp_streamable_route", "self._setup_mcp_sse_route"] | 0 | [] | The function (setup_mcp_server) defined within the protected class called _ActionRoutes.The function start at line 116 and ends at 136. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [116.0] and does not return any value. It declares 6.0 functions, and It ha... |
Sema4AI_actions | public | public | 0 | 0 | _setup_mcp_streamable_route.handle_streamable_http | async def handle_streamable_http(scope: Scope, receive: Receive, send: Send) -> None:assert self._session_manager is not Noneawait self._session_manager.handle_request(scope, receive, send) | 1 | 5 | 3 | 37 | 0 | 155 | 159 | 155 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_setup_mcp_streamable_route.handle_streamable_http) defined within the public class called public.The function start at line 155 and ends at 159. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [155.0] and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | _setup_mcp_streamable_route.lifespan | async def lifespan(app):async with self._session_manager.run():yield | 1 | 3 | 1 | 16 | 0 | 171 | 173 | 171 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_setup_mcp_streamable_route.lifespan) defined within the public class called public.The function start at line 171 and ends at 173. 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.. |
Sema4AI_actions | _ActionRoutes | protected | 0 | 0 | _setup_mcp_streamable_route | def _setup_mcp_streamable_route(self, app: _CustomFastAPI, middleware: list[Middleware]):from contextlib import asynccontextmanagerfrom mcp.server.streamable_http_manager import StreamableHTTPSessionManagerfrom starlette.applications import Starlettefrom starlette.routing import Mount, Routeassert self._session_manager... | 1 | 31 | 3 | 145 | 0 | 138 | 185 | 138 | self,app,middleware | [] | None | {"AnnAssign": 1, "Assign": 2, "Expr": 5} | 8 | 48 | 8 | ["StreamableHTTPSessionManager", "self._session_manager.handle_request", "routes.append", "Mount", "self._session_manager.run", "app.custom_lifespan.register", "Starlette", "app.mount"] | 0 | [] | The function (_setup_mcp_streamable_route) defined within the protected class called _ActionRoutes.The function start at line 138 and ends at 185. It contains 31 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [138.0] and does not return any value. It declares 8.0 functions,... |
Sema4AI_actions | public | public | 0 | 0 | _setup_mcp_sse_route.handle_sse | async def handle_sse(scope: Scope, receive: Receive, send: Send):async with sse.connect_sse(scope,receive,send,) as streams:await self.mcp_server_setup_helper.server.run(streams[0],streams[1],self.mcp_server_setup_helper.server.create_initialization_options(),)return Response() | 1 | 12 | 3 | 65 | 0 | 199 | 210 | 199 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_setup_mcp_sse_route.handle_sse) defined within the public class called public.The function start at line 199 and ends at 210. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [199.0] and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | _setup_mcp_sse_route.sse_endpoint | async def sse_endpoint(request: Request) -> Response:# Convert the Starlette request to ASGI parametersreturn await handle_sse(request.scope, request.receive, request._send)# type: ignore[reportPrivateUsage] | 1 | 2 | 1 | 25 | 0 | 212 | 214 | 212 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_setup_mcp_sse_route.sse_endpoint) defined within the public class called public.The function start at line 212 and ends at 214. 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 | _ActionRoutes | protected | 0 | 0 | _setup_mcp_sse_route | def _setup_mcp_sse_route(self, app: _CustomFastAPI, middleware: list[Middleware]):from mcp.server.sse import SseServerTransportfrom starlette.applications import Starlettefrom starlette.routing import Mount, Route# -- Setup SSEsse = SseServerTransport("/messages/")routes: list[Route | Mount] = []from starlette.requests... | 1 | 25 | 3 | 137 | 0 | 187 | 231 | 187 | self,app,middleware | [] | Returns | {"AnnAssign": 1, "Assign": 2, "Expr": 4, "Return": 2} | 12 | 45 | 12 | ["SseServerTransport", "sse.connect_sse", "self.mcp_server_setup_helper.server.run", "self.mcp_server_setup_helper.server.create_initialization_options", "Response", "handle_sse", "routes.append", "Route", "routes.append", "Mount", "Starlette", "app.mount"] | 0 | [] | The function (_setup_mcp_sse_route) defined within the protected class called _ActionRoutes.The function start at line 187 and ends at 231. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [187.0], and this function return a value. It declares 12.0 functions, a... |
Sema4AI_actions | _ActionRoutes | protected | 0 | 0 | register_actions | def register_actions(self) -> None:import jsonfrom sema4ai.action_server._settings import (OPENAPI_SPEC_IS_CONSEQUENTIAL,OPENAPI_SPEC_OPERATION_KIND,)from . import _actions_runfrom ._app import get_appfrom ._models import Action, ActionPackage, get_dbdb = get_db()app = get_app()action: Actionaction_package_id_to_action... | 13 | 85 | 1 | 405 | 0 | 233 | 333 | 233 | self | [] | None | {"AnnAssign": 4, "Assign": 20, "Expr": 5, "For": 1, "If": 10} | 20 | 101 | 20 | ["get_db", "get_app", "dict", "db.all", "db.all", "set", "get_action_description_from_docs", "action_package_id_to_action_package.get", "log.critical", "accept_action", "log.info", "_make_name_user_friendly", "json.loads", "options_as_dict.get", "options_as_dict.get", "_actions_run.generate_func_from_action", "build_ur... | 0 | [] | The function (register_actions) defined within the protected class called _ActionRoutes.The function start at line 233 and ends at 333. It contains 85 lines of code and it has a cyclomatic complexity of 13. The function does not take any parameters and does not return any value. It declares 20.0 functions, and It has ... |
Sema4AI_actions | _ActionRoutes | protected | 0 | 0 | unregister_actions | def unregister_actions(self):from sema4ai.action_server._app import get_app# We need to iterate backwards to remove with indexes.app = get_app()i = len(app.router.routes)for route in reversed(app.router.routes):i -= 1if route.path_format in self.registered_route_names:log.debug("Unregistering route: %s", route.path_for... | 3 | 10 | 1 | 78 | 0 | 335 | 347 | 335 | self | [] | None | {"Assign": 2, "AugAssign": 1, "Expr": 2, "For": 1, "If": 1} | 5 | 13 | 5 | ["get_app", "len", "reversed", "log.debug", "self.mcp_server_setup_helper.unregister_actions"] | 0 | [] | The function (unregister_actions) defined within the protected class called _ActionRoutes.The function start at line 335 and ends at 347. It contains 10 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 5.0 functions, and It has ... |
Sema4AI_actions | public | public | 0 | 0 | get_resolved_provider_settings | def get_resolved_provider_settings(provider: str) -> "OAuth2ProviderSettingsResolved":import osfrom sema4ai.action_server._settings import get_settingsfrom sema4ai.action_server.vendored_deps.oauth2_settings import (get_oauthlib2_provider_settings,)app_settings = get_settings()if not app_settings.use_https:os.environ["... | 3 | 17 | 1 | 72 | 2 | 56 | 76 | 56 | provider | ['oauth2_settings_file', 'app_settings'] | 'OAuth2ProviderSettingsResolved' | {"Assign": 3, "If": 2, "Return": 1} | 3 | 21 | 3 | ["get_settings", "RuntimeError", "get_oauthlib2_provider_settings"] | 7 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_process_pool_py.ProcessHandle._do_run_action", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4... | The function (get_resolved_provider_settings) defined within the public class called public.The function start at line 56 and ends at 76. It contains 17 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, It has 3.0 f... |
Sema4AI_actions | public | public | 0 | 0 | oauth2_logout | async def oauth2_logout(provider: str,request: Request,response: Response,reference_id: str = "",) -> StatusResponseModel:from sema4ai.action_server._encryption import decrypt_simplefrom sema4ai.action_server._models import OAuth2UserData, get_dbfrom sema4ai.action_server._user_session import (referenced_session_scope,... | 10 | 58 | 4 | 294 | 9 | 80 | 153 | 80 | provider,request,response,reference_id | ['response_model', 'settings', 'db', 'use_session_scope', 'headers', 'payload', 'revoke_url', 'p', 'token'] | StatusResponseModel | {"AnnAssign": 2, "Assign": 13, "Expr": 3, "For": 2, "If": 6, "Return": 1, "Try": 1, "With": 2} | 18 | 74 | 18 | ["referenced_session_scope", "session_scope", "get_db", "db.connect", "db.where_from_dict", "dict", "db.all", "db.transaction", "db.delete_where", "get_resolved_provider_settings", "getattr", "typing.cast", "decrypt_simple", "log.critical", "requests.post", "log.critical", "StatusResponseModel", "oauth2_api_router.get"... | 0 | [] | The function (oauth2_logout) defined within the public class called public.The function start at line 80 and ends at 153. It contains 58 lines of code and it has a cyclomatic complexity of 10. It takes 4 parameters, represented as [80.0] and does not return any value. It declares 18.0 functions, and It has 18.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | oauth2_login.is_localhost | def is_localhost(url):from urllib.parse import urlparseparsed_url = urlparse(url)return (parsed_url.scheme and parsed_url.scheme.lower() in ("http", "https")) and (parsed_url.netloc == "localhost"or parsed_url.netloc.startswith("127.")or parsed_url.netloc == "::1") | 5 | 10 | 1 | 60 | 0 | 184 | 194 | 184 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (oauth2_login.is_localhost) defined within the public class called public.The function start at line 184 and ends at 194. It contains 10 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | oauth2_login | async def oauth2_login(provider: str,scopes: str,request: Request,reference_id: str = "",callback_url: str = "",) -> RedirectResponse:"""Args:provider: The provider (google, github, etc)scopes: A space-separated list of scopes requested.reference_id: If given the authentication info will later on be accessible throught... | 6 | 53 | 5 | 281 | 10 | 157 | 240 | 157 | provider,scopes,request,reference_id,callback_url | ['parsed_url', 'settings', 'base_url', 'app_settings', 'oauth2_session', 'response', 'params', 'message', 'code_verifier', 'auth_url'] | RedirectResponse | {"AnnAssign": 1, "Assign": 13, "Expr": 5, "If": 4, "Return": 2, "With": 1} | 22 | 84 | 22 | ["log.info", "log.info", "urlparse", "parsed_url.scheme.lower", "parsed_url.netloc.startswith", "is_localhost", "log.critical", "AssertionError", "get_db", "db.connect", "db.transaction", "session_scope", "get_resolved_provider_settings", "get_settings", "_create_oauth2_session", "scopes.split", "oauth2_session.authori... | 0 | [] | The function (oauth2_login) defined within the public class called public.The function start at line 157 and ends at 240. It contains 53 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [157.0] and does not return any value. It declares 22.0 functions, and It has 22.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | oauth2_status | async def oauth2_status(request: Request,response: "Response",reference_id: str = "",refresh_tokens: bool = False,force_refresh: bool = False,provide_access_token: bool = False,) -> dict[str, OAuth2StatusResponseForProvider]:"""Collects the current status for the OAuth2 (either for thecurrent session or the passed `ref... | 16 | 72 | 6 | 394 | 9 | 251 | 345 | 251 | request,response,reference_id,refresh_tokens,force_refresh,provide_access_token | ['current_oauth2_user_data', 'db', 'settings', 'access_token', 'provide_access_token', 'use_session_scope', '_new_oauth2_data', 'must_renew', 'use_id'] | dict[str, OAuth2StatusResponseForProvider] | {"AnnAssign": 5, "Assign": 17, "Expr": 2, "For": 2, "If": 6, "Return": 1, "Try": 1, "With": 1} | 19 | 95 | 19 | ["referenced_session_scope", "session_scope", "get_db", "db.connect", "db.where_from_dict", "dict", "db.all", "_can_renew", "_should_renew", "run_in_thread_asyncio", "partial", "db.all", "get_resolved_provider_settings", "typing.cast", "decrypt_simple", "log.critical", "OAuth2StatusResponseForProvider", "json.loads", "... | 0 | [] | The function (oauth2_status) defined within the public class called public.The function start at line 251 and ends at 345. It contains 72 lines of code and it has a cyclomatic complexity of 16. It takes 6 parameters, represented as [251.0] and does not return any value. It declares 19.0 functions, and It has 19.0 func... |
Sema4AI_actions | public | public | 0 | 0 | refresh_tokens | def refresh_tokens(use_id: str, oauth2_user_data_lst: Iterable["OAuth2UserData"]) -> list["OAuth2UserData"]:"""Args:use_id: The id of the session to which the tokens are related to.oauth2_user_data_lst: The OAuth2 information that should have theaccess_token refreshed."""new_lst: list["OAuth2UserData"] = []for oauth2_u... | 3 | 11 | 2 | 67 | 0 | 348 | 367 | 348 | use_id,oauth2_user_data_lst | [] | list['OAuth2UserData'] | {"AnnAssign": 1, "Expr": 3, "For": 1, "If": 1, "Return": 1} | 4 | 20 | 4 | ["_should_renew", "new_lst.append", "_refresh_token", "new_lst.append"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_process_pool_py.ProcessHandle._do_run_action"] | The function (refresh_tokens) defined within the public class called public.The function start at line 348 and ends at 367. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [348.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions c... |
Sema4AI_actions | public | public | 0 | 0 | _refresh_token | def _refresh_token(use_id: str, oauth2_user_data: "OAuth2UserData") -> "OAuth2UserData":"""Refreshes the tokens from the input user data (in the given session).Updates the information in the database and returns a new OAuth2UserDatainstance with the updated values (the input instance will be unchanged)."""from sema4ai.... | 4 | 34 | 2 | 148 | 9 | 370 | 415 | 370 | use_id,oauth2_user_data | ['decrypted', 'token', 'settings', 'token_url', 'client_secret', 'oauth2_session', 'refresh_token', 'code_verifier', 'client_id'] | 'OAuth2UserData' | {"Assign": 10, "Expr": 1, "If": 2, "Return": 1, "Try": 1} | 9 | 46 | 9 | ["get_resolved_provider_settings", "decrypt_simple", "isinstance", "_create_oauth2_session", "RuntimeError", "decrypt_simple", "RuntimeError", "oauth2_session.refresh_token", "_update_db_with_token"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oauth2_py.refresh_tokens"] | The function (_refresh_token) defined within the public class called public.The function start at line 370 and ends at 415. It contains 34 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [370.0] and does not return any value. It declares 9.0 functions, It has 9.0 functions c... |
Sema4AI_actions | public | public | 0 | 0 | _can_renew | def _can_renew(oauth2_user_data: "OAuth2UserData") -> bool:"""Args:oauth2_user_data: The data to be checkedReturns:True if the oauth2 access_token should be renewed and False otherwise."""from sema4ai.action_server._encryption import decrypt_simpleif not oauth2_user_data.refresh_token:# Unable to renew in this case as ... | 4 | 14 | 1 | 54 | 0 | 418 | 441 | 418 | oauth2_user_data | [] | bool | {"Expr": 2, "If": 2, "Return": 4, "Try": 1} | 2 | 24 | 2 | ["decrypt_simple", "log.critical"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oauth2_py._should_renew", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oau... | The function (_can_renew) defined within the public class called public.The function start at line 418 and ends at 441. It contains 14 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 2.0 functions, It has 2.0 functions called in... |
Sema4AI_actions | public | public | 0 | 0 | _should_renew | def _should_renew(oauth2_user_data: "OAuth2UserData") -> bool:"""Args:oauth2_user_data: The data to be checkedReturns:True if the oauth2 access_token should be renewed and False otherwise."""from sema4ai.action_server._user_session import iso_to_datetimeif not _can_renew(oauth2_user_data):return Falseif not oauth2_user... | 3 | 10 | 1 | 68 | 3 | 444 | 463 | 444 | oauth2_user_data | ['refresh_newer_than', 'now', 'd'] | bool | {"Assign": 3, "Expr": 1, "If": 2, "Return": 3} | 4 | 20 | 4 | ["_can_renew", "iso_to_datetime", "datetime.datetime.now", "datetime.timedelta"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oauth2_py.oauth2_status", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oau... | The function (_should_renew) defined within the public class called public.The function start at line 444 and ends at 463. It contains 10 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 4.0 functions, It has 4.0 functions called... |
Sema4AI_actions | public | public | 0 | 0 | create_reference_id | async def create_reference_id() -> CreatedReferenceId:"""Creates a new reference ID (using this reference it's later possibleto obtain the access_token and query the state of the OAuth2 authentication)."""from sema4ai.action_server._user_session import create_user_sessionresponse = CreatedReferenceId(reference_id=creat... | 1 | 4 | 0 | 32 | 1 | 471 | 479 | 471 | ['response'] | CreatedReferenceId | {"Assign": 1, "Expr": 1, "Return": 1} | 3 | 9 | 3 | ["CreatedReferenceId", "create_user_session", "oauth2_api_router.get"] | 0 | [] | The function (create_reference_id) defined within the public class called public.The function start at line 471 and ends at 479. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 functi... | |
Sema4AI_actions | public | public | 0 | 0 | _create_oauth2_session | def _create_oauth2_session(provider: str,state: Optional[str] = None,*,scope: Optional[Sequence[str]] = (),code_verifier: Optional[str] = None,) -> "OAuth2Session":from requests_oauthlib import OAuth2Session# type: ignorefrom sema4ai.action_server._settings import get_settingssettings = get_resolved_provider_settings(p... | 5 | 26 | 3 | 149 | 6 | 482 | 517 | 482 | provider,state,scope,code_verifier | ['settings', 'base_url', 'app_settings', 'redirect_uri', 'oauth2_session', 'client_id'] | 'OAuth2Session' | {"AnnAssign": 1, "Assign": 9, "If": 3, "Return": 1} | 3 | 36 | 3 | ["get_resolved_provider_settings", "get_settings", "OAuth2Session"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oauth2_py._refresh_token", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oa... | The function (_create_oauth2_session) defined within the public class called public.The function start at line 482 and ends at 517. It contains 26 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [482.0] and does not return any value. It declares 3.0 functions, It has 3.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | _update_db_with_token | def _update_db_with_token(use_id: str, provider: str, token, *, code_verifier: str) -> "OAuth2UserData":from sema4ai.action_server._database import Databasefrom sema4ai.action_server._encryption import encrypt_simplefrom sema4ai.action_server._models import OAuth2UserData, get_dbfrom sema4ai.action_server._user_session... | 9 | 45 | 4 | 276 | 7 | 520 | 579 | 520 | use_id,provider,token,code_verifier | ['scopes_lst', 'access_token', 'scopes', 'token_type', 'expires_at', 'refresh_token', 'data'] | 'OAuth2UserData' | {"AnnAssign": 1, "Assign": 11, "Expr": 3, "If": 5, "Return": 1, "With": 1} | 18 | 60 | 18 | ["token.get", "token.scope.split", "token.scope.split", "json.dumps", "token.get", "log.info", "token.get", "datetime_to_iso", "log.info", "token.get", "OAuth2UserData", "encrypt_simple", "encrypt_simple", "encrypt_simple", "get_db", "db.connect", "db.transaction", "db.insert_or_update"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oauth2_py._refresh_token", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_oa... | The function (_update_db_with_token) defined within the public class called public.The function start at line 520 and ends at 579. It contains 45 lines of code and it has a cyclomatic complexity of 9. It takes 4 parameters, represented as [520.0] and does not return any value. It declares 18.0 functions, It has 18.0 fu... |
Sema4AI_actions | public | public | 0 | 0 | oauth2_redirect | async def oauth2_redirect(request: Request, state: str = "") -> HTMLResponse:"""Callback that should've been registered in the OAuth2 callback tocomplete the authentication flow."""from sema4ai.action_server._user_session import session_scopewith session_scope(request) as session:oauth_state = session.get_session_data(... | 9 | 98 | 2 | 333 | 15 | 583 | 699 | 583 | request,state | ['callback_url', 'settings', 'token_url', 'client_secret', 'oauth_state', 'headers', 'code_verifier', 'provider', 'oauth2_session', 'response', 'use_id', 'result', 'reference_id', 'data', 'token'] | HTMLResponse | {"Assign": 17, "Expr": 3, "If": 6, "Return": 1, "With": 1} | 23 | 117 | 23 | ["session_scope", "session.get_session_data", "RuntimeError", "isinstance", "RuntimeError", "typing.cast", "typing.cast", "typing.cast", "typing.cast", "isinstance", "isinstance", "isinstance", "get_resolved_provider_settings", "headers.update", "_create_oauth2_session", "oauth2_session.fetch_token", "str", "_update_db... | 0 | [] | The function (oauth2_redirect) defined within the public class called public.The function start at line 583 and ends at 699. It contains 98 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [583.0] and does not return any value. It declares 23.0 functions, and It has 23.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | list_runs | def list_runs():from ._runs_state_cache import get_global_runs_stateglobal_runs_state = get_global_runs_state()with global_runs_state.semaphore:return global_runs_state.get_current_run_state() | 1 | 5 | 0 | 25 | 1 | 19 | 24 | 19 | ['global_runs_state'] | Returns | {"Assign": 1, "Return": 1, "With": 1} | 3 | 6 | 3 | ["get_global_runs_state", "global_runs_state.get_current_run_state", "run_api_router.get"] | 0 | [] | The function (list_runs) defined within the public class called public.The function start at line 19 and ends at 24. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0 functions call... | |
Sema4AI_actions | public | public | 0 | 0 | get_run_by_id | def get_run_by_id(run_id: str) -> Run:try:from ._runs_state_cache import get_global_runs_stateglobal_runs_state = get_global_runs_state()with global_runs_state.semaphore:return global_runs_state.get_run_from_id(run_id)except KeyError as err:from fastapi.exceptions import HTTPExceptionfrom starlette import statusraise H... | 2 | 13 | 1 | 65 | 1 | 27 | 41 | 27 | run_id | ['global_runs_state'] | Run | {"Assign": 1, "Return": 1, "Try": 1, "With": 1} | 3 | 15 | 3 | ["get_global_runs_state", "global_runs_state.get_run_from_id", "HTTPException"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py._get_artifacts_dir_for_run_id", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_se... | The function (get_run_by_id) defined within the public class called public.The function start at line 27 and ends at 41. 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, It has 3.0 functions called i... |
Sema4AI_actions | public | public | 0 | 0 | show_run | def show_run(run_id: str = fastapi.Path(title="ID for run")):# Note that we want to usereturn get_run_by_id(run_id) | 1 | 2 | 1 | 21 | 0 | 45 | 47 | 45 | run_id | [] | Returns | {"Return": 1} | 3 | 3 | 3 | ["fastapi.Path", "get_run_by_id", "run_api_router.get"] | 0 | [] | The function (show_run) defined within the public class called public.The function start at line 45 and ends at 47. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 3.0 functions, and It has 3.0 functions calle... |
Sema4AI_actions | public | public | 0 | 0 | show_run_fields | def show_run_fields(run_id: str = fastapi.Path(title="ID for run"),fields: Optional[List[str]] = fastapi.Query(default=None),):import dataclassesrun = get_run_by_id(run_id)dct = dataclasses.asdict(run)if fields:dct = {k: v for k, v in dct.items() if k in fields}return dct | 4 | 10 | 1 | 78 | 2 | 51 | 61 | 51 | run_id,fields | ['dct', 'run'] | Returns | {"Assign": 3, "If": 1, "Return": 1} | 6 | 11 | 6 | ["fastapi.Path", "fastapi.Query", "get_run_by_id", "dataclasses.asdict", "dct.items", "run_api_router.get"] | 0 | [] | The function (show_run_fields) defined within the public class called public.The function start at line 51 and ends at 61. It contains 10 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 6.0 functions, and It has 6.0 functio... |
Sema4AI_actions | public | public | 0 | 0 | cancel_run | def cancel_run(run_id: str = fastapi.Path(title="ID for run"),) -> Literal["cancelled", "not-running"]:"""Cancels a running action.Returns:True if the run was canceled, False otherwise (if the run was not running)."""from ._runs_state_cache import RunsState, get_global_runs_stateglobal_runs_state: RunsState = get_globa... | 2 | 9 | 1 | 53 | 0 | 65 | 80 | 65 | run_id | [] | Literal['cancelled', 'not-running'] | {"AnnAssign": 1, "Expr": 1, "If": 1, "Return": 2} | 4 | 16 | 4 | ["fastapi.Path", "get_global_runs_state", "global_runs_state.cancel_run", "run_api_router.post"] | 0 | [] | The function (cancel_run) defined within the public class called public.The function start at line 65 and ends at 80. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functions called ... |
Sema4AI_actions | public | public | 0 | 0 | run_id_from_request_id | def run_id_from_request_id(request_id: str = fastapi.Path(title="Request ID")):"""Returns the run id associated with the request id."""from fastapi.exceptions import HTTPExceptionfrom starlette import statusif not request_id:raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST,detail="Request ID is required.",)f... | 3 | 19 | 1 | 101 | 2 | 91 | 115 | 91 | request_id | ['global_runs_state', 'run'] | Returns | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1, "Try": 1, "With": 1} | 7 | 25 | 7 | ["fastapi.Path", "HTTPException", "get_global_runs_state", "global_runs_state.get_run_from_request_id", "RunIdFromRequestId", "HTTPException", "run_api_router.get"] | 0 | [] | The function (run_id_from_request_id) defined within the public class called public.The function start at line 91 and ends at 115. It contains 19 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters, and this function return a value. It declares 7.0 functions, and It has 7.0... |
Sema4AI_actions | public | public | 0 | 0 | _scandir_recursive | def _scandir_recursive(path):for entry in os.scandir(path):if entry.is_dir(follow_symlinks=False):yield from _scandir_recursive(entry.path)else:yield entry | 3 | 6 | 1 | 37 | 0 | 124 | 129 | 124 | path | [] | None | {"Expr": 2, "For": 1, "If": 1} | 3 | 6 | 3 | ["os.scandir", "entry.is_dir", "_scandir_recursive"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py._get_file_info_in_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._a... | The function (_scandir_recursive) defined within the public class called public.The function start at line 124 and ends at 129. It contains 6 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, It has 3.0 functions ca... |
Sema4AI_actions | public | public | 0 | 0 | _sort_robolog_files.get_sort_key | def get_sort_key(file_path):# Get the filename without pathfilename = file_path.name# Remove the .robolog extensionname_without_ext = os.path.splitext(filename)[0]# Split by the last underscore to separate base name and numberif "_" in name_without_ext:parts = name_without_ext.rsplit("_", 1)base_name = parts[0]try:numb... | 3 | 14 | 1 | 75 | 0 | 140 | 160 | 140 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (_sort_robolog_files.get_sort_key) defined within the public class called public.The function start at line 140 and ends at 160. It contains 14 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value.. |
Sema4AI_actions | public | public | 0 | 0 | _sort_robolog_files | def _sort_robolog_files(robolog_files: Sequence[Path]) -> list[Path]:"""Sort robolog files according to the heuristic:- Files are named like '<name>.robolog', '<name>_1.robolog', '<name>_2.robolog', etc.- Strip the extension and split by the last underscore to get the number.- Sort by the base name first, then by the n... | 1 | 3 | 1 | 27 | 5 | 132 | 162 | 132 | robolog_files | ['name_without_ext', 'filename', 'base_name', 'number', 'parts'] | list[Path] | {"Assign": 8, "Expr": 1, "If": 1, "Return": 2, "Try": 1} | 4 | 31 | 4 | ["os.path.splitext", "name_without_ext.rsplit", "int", "sorted"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py.get_run_log_html", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server_tests.test_sor... | The function (_sort_robolog_files) defined within the public class called public.The function start at line 132 and ends at 162. 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 4.0 functions, It has 4.0 functions c... |
Sema4AI_actions | public | public | 0 | 0 | _get_file_info_in_path | def _get_file_info_in_path(path: Path) -> List[ArtifactInfo]:file_names = []for entry in _scandir_recursive(path):try:if entry.is_file():size = entry.stat().st_sizename = Path(entry.path).relative_to(path).as_posix()file_names.append(ArtifactInfo(name, size))except Exception:log.exception(f"Unable to get information fr... | 4 | 12 | 1 | 83 | 3 | 165 | 176 | 165 | path | ['size', 'file_names', 'name'] | List[ArtifactInfo] | {"Assign": 3, "Expr": 2, "For": 1, "If": 1, "Return": 1, "Try": 1} | 9 | 12 | 9 | ["_scandir_recursive", "entry.is_file", "entry.stat", "as_posix", "relative_to", "Path", "file_names.append", "ArtifactInfo", "log.exception"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py.get_run_artifact_text", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._ap... | The function (_get_file_info_in_path) defined within the public class called public.The function start at line 165 and ends at 176. It contains 12 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 functio... |
Sema4AI_actions | public | public | 0 | 0 | get_run_artifacts | def get_run_artifacts(run_id: str = fastapi.Path(title="ID for run"),) -> Annotated[List[ArtifactInfo],Param(description="""Provides a list with the artifacts availablefor a given run (i.e.: [{'name': '__action_server_output.txt', 'size_in_bytes': 22}])"""), | 1 | 9 | 1 | 31 | 0 | 180 | 188 | 180 | run_id | [] | Annotated[List[ArtifactInfo], Param(description="Provides a list with the artifacts available\nfor a given run (i.e.: [{'name': '__action_server_output.txt', 'size_in_bytes': 22}])\n")] | {"Assign": 4, "Expr": 2, "If": 2, "Return": 3} | 9 | 31 | 9 | ["fastapi.Path", "get_settings", "get_run_by_id", "log.critical", "artifacts_in.exists", "log.critical", "_get_file_info_in_path", "run_api_router.get", "Param"] | 0 | [] | The function (get_run_artifacts) defined within the public class called public.The function start at line 180 and ends at 188. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has 9.0 function... |
Sema4AI_actions | public | public | 0 | 0 | get_run_log_html | def get_run_log_html(run_id: str = fastapi.Path(title="ID for run")):import iofrom fastapi.exceptions import HTTPExceptionartifacts_in = _get_artifacts_dir_for_run_id(run_id)if artifacts_in is None:raise HTTPException(status_code=404, detail="log.html not available for requested run.")log_html = artifacts_in / "log.htm... | 4 | 26 | 1 | 156 | 5 | 214 | 250 | 214 | run_id | ['robolog_files', 'stream', 'log_html', 'contents', 'artifacts_in'] | Returns | {"AnnAssign": 1, "Assign": 5, "Expr": 1, "If": 3, "Return": 2} | 14 | 37 | 14 | ["fastapi.Path", "_get_artifacts_dir_for_run_id", "HTTPException", "os.path.exists", "list", "artifacts_in.glob", "io.BytesIO", "_sort_robolog_files", "_write_index_updating_sample", "Response", "stream.getvalue", "HTTPException", "FileResponse", "run_api_router.get"] | 0 | [] | The function (get_run_log_html) defined within the public class called public.The function start at line 214 and ends at 250. It contains 26 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 14.0 functions, and It has 14.0 fu... |
Sema4AI_actions | public | public | 0 | 0 | _write_index_updating_sample | def _write_index_updating_sample(stream, contents, robolog_files):# Note: the version here only needs to be changed if the# version is changed in the sample.ts.string_start = contents.index("String.raw`V 0.0.2")string_end = contents.index("`", string_start + 18)string_end = contents.index("}", string_end)assert string_... | 3 | 16 | 3 | 109 | 5 | 253 | 275 | 253 | stream,contents,robolog_files | ['found', 'i', 'c', 'string_end', 'string_start'] | None | {"Assign": 7, "AugAssign": 1, "Expr": 2, "If": 1, "While": 1} | 7 | 23 | 7 | ["contents.index", "contents.index", "contents.index", "found.insert", "startswith", "join", "_write_updating_sample"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py.get_run_log_html"] | The function (_write_index_updating_sample) defined within the public class called public.The function start at line 253 and ends at 275. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [253.0] and does not return any value. It declares 7.0 functions, It has 7... |
Sema4AI_actions | public | public | 0 | 0 | _write_updating_sample | def _write_updating_sample(stream, contents, start_index, end_index, robolog_files):import base64stream.write(contents[:start_index].encode("utf-8"))import zlibwrite = stream.writewrite(b"\nlet chunks = [")for f in robolog_files:try:# We are reading contents that may change, so, it's not impossible that the# file was t... | 6 | 28 | 5 | 153 | 2 | 278 | 350 | 278 | stream,contents,start_index,end_index,robolog_files | ['write', 'chunk'] | None | {"Assign": 3, "Expr": 10, "For": 1, "If": 1, "Try": 2, "While": 1, "With": 1} | 16 | 73 | 16 | ["stream.write", "encode", "write", "open", "fsrc.read", "log.exception", "write", "zlib.compress", "write", "base64.b64encode", "write", "log.exception", "write", "write", "stream.write", "encode"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py._write_index_updating_sample"] | The function (_write_updating_sample) defined within the public class called public.The function start at line 278 and ends at 350. It contains 28 lines of code and it has a cyclomatic complexity of 6. It takes 5 parameters, represented as [278.0] and does not return any value. It declares 16.0 functions, It has 16.0 f... |
Sema4AI_actions | public | public | 0 | 0 | _get_artifacts_dir_for_run_id | def _get_artifacts_dir_for_run_id(run_id: str) -> Optional[Path]:from sema4ai.action_server._settings import get_settingssettings = get_settings()run = get_run_by_id(run_id)artifacts_dir = settings.artifacts_dirif not settings.artifacts_dir:log.critical("Unable to get artifacts because the settings artifacts_dir is not... | 3 | 18 | 1 | 83 | 4 | 353 | 374 | 353 | run_id | ['artifacts_dir', 'settings', 'run', 'artifacts_in'] | Optional[Path] | {"Assign": 4, "Expr": 2, "If": 2, "Return": 3} | 6 | 22 | 6 | ["get_settings", "get_run_by_id", "log.critical", "absolute", "artifacts_in.exists", "log.critical"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._api_run_py.get_run_artifact_text", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._ap... | The function (_get_artifacts_dir_for_run_id) defined within the public class called public.The function start at line 353 and ends at 374. It contains 18 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, It has 6.0 ... |
Sema4AI_actions | public | public | 0 | 0 | get_run_artifact_text | def get_run_artifact_text(run_id: str = fastapi.Path(title="ID for run"),artifact_names: Optional[List[str]] = fastapi.Query(default=None, title="Artifact names for which the content should be gotten."),artifact_name_regexp: Optional[str] = fastapi.Query(default=None,title="A regexp to match artifact names.",),) -> Dic... | 11 | 47 | 1 | 246 | 5 | 378 | 436 | 378 | run_id,artifact_names,artifact_name_regexp | ['pattern', 'artifact_names', 'f', 'artifacts_in', 'checked'] | Dict[str, str] | {"AnnAssign": 1, "Assign": 6, "Expr": 6, "For": 2, "If": 6, "Return": 2, "Try": 2} | 19 | 59 | 19 | ["fastapi.Path", "fastapi.Query", "fastapi.Query", "_get_artifacts_dir_for_run_id", "set", "re.compile", "_get_file_info_in_path", "pattern.match", "artifact_names.append", "checked.add", "absolute", "f.exists", "log.critical", "relative_to", "Path", "log.critical", "f.read_text", "log.critical", "run_api_router.get"] | 0 | [] | The function (get_run_artifact_text) defined within the public class called public.The function start at line 378 and ends at 436. It contains 47 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value. It declares 19.0 functions, and It has 19.0 ... |
Sema4AI_actions | public | public | 0 | 0 | get_run_artifact_binary | def get_run_artifact_binary(run_id: str = fastapi.Path(title="ID for run"),artifact_name: str = fastapi.Query(title="Artifact name for which the content should be gotten."),):from sema4ai.action_server._settings import get_settingssettings = get_settings()run = get_run_by_id(run_id)artifacts_dir = settings.artifacts_di... | 5 | 37 | 1 | 154 | 5 | 440 | 482 | 440 | run_id,artifact_name | ['settings', 'artifacts_dir', 'f', 'artifacts_in', 'run'] | Returns | {"Assign": 5, "Expr": 5, "If": 3, "Return": 5, "Try": 1} | 15 | 43 | 15 | ["fastapi.Path", "fastapi.Query", "get_settings", "get_run_by_id", "log.critical", "artifacts_in.exists", "log.critical", "absolute", "f.exists", "log.critical", "relative_to", "Path", "log.critical", "FileResponse", "run_api_router.get"] | 0 | [] | The function (get_run_artifact_binary) defined within the public class called public.The function start at line 440 and ends at 482. It contains 37 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters, and this function return a value. It declares 15.0 functions, and It has ... |
Sema4AI_actions | InMemorySecrets | public | 0 | 0 | __init__ | def __init__(self) -> None:self._global_scope_secrets: dict[str, str] = {}self._action_package_scope_secrets: dict[str, dict[str, str]] = {} | 1 | 3 | 1 | 38 | 0 | 27 | 29 | 27 | self | [] | None | {"AnnAssign": 2} | 0 | 3 | 0 | [] | 6,243 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec... | The function (__init__) defined within the public class called InMemorySecrets.The function start at line 27 and ends at 29. 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 has 6243.0 functions calling this function which a... |
Sema4AI_actions | InMemorySecrets | public | 0 | 0 | update_headers | def update_headers(self, action_package: "ActionPackage", action: "Action", headers: dict[str, str]):from sema4ai.action_server._encryption import (get_encryption_keys,make_encrypted_data_envelope,make_unencrypted_data_envelope,)secrets: dict[str, str] = {}if self._global_scope_secrets:secrets.update(self._global_scope... | 7 | 31 | 4 | 169 | 0 | 31 | 71 | 31 | self,action_package,action,headers | [] | Returns | {"AnnAssign": 2, "Assign": 3, "Expr": 3, "For": 1, "If": 5, "Return": 2} | 9 | 41 | 9 | ["secrets.update", "self._action_package_scope_secrets.get", "secrets.update", "k.lower", "log.info", "get_encryption_keys", "headers.copy", "make_unencrypted_data_envelope", "make_encrypted_data_envelope"] | 0 | [] | The function (update_headers) defined within the public class called InMemorySecrets.The function start at line 31 and ends at 71. It contains 31 lines of code and it has a cyclomatic complexity of 7. It takes 4 parameters, represented as [31.0], and this function return a value. It declares 9.0 functions, and It has ... |
Sema4AI_actions | InMemorySecrets | public | 0 | 0 | _update_secrets | def _update_secrets(self,secrets: dict[str, str],scope: Literal["global"] | ActionPackageScopeTypedDict,):from sema4ai.action_server._models import ActionPackage, get_dbif scope == "global":# Note: resets previous valuesself._global_scope_secrets = secretselif isinstance(scope, dict) and scope.get("action-package"):# N... | 6 | 23 | 3 | 124 | 0 | 73 | 101 | 73 | self,secrets,scope | [] | None | {"Assign": 5, "If": 3, "With": 1} | 8 | 29 | 8 | ["isinstance", "scope.get", "get_db", "db.connect", "set", "db.all", "ValueError", "ValueError"] | 0 | [] | The function (_update_secrets) defined within the public class called InMemorySecrets.The function start at line 73 and ends at 101. It contains 23 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [73.0] and does not return any value. It declares 8.0 functions, and It has 8.... |
Sema4AI_actions | public | public | 0 | 0 | set_secrets | async def set_secrets(data: SetSecretData) -> str:"""API to set secrets in memory which will later be passed on to actions when they're run(those are later passed using the x-action-context -- it's meant to beused in cases where a process is managing the action server but is not interceptingrequests to set the x-action... | 10 | 34 | 1 | 189 | 4 | 112 | 164 | 112 | data | ['encrypted_data', 'secrets', 'value', 'scope'] | str | {"Assign": 4, "Expr": 2, "For": 1, "If": 8, "Return": 1} | 21 | 53 | 21 | ["MaybeEncryptedJsonData", "isinstance", "ValueError", "type", "value.get", "value.get", "ValueError", "ValueError", "isinstance", "ValueError", "secrets.items", "isinstance", "ValueError", "isinstance", "isinstance", "ValueError", "ValueError", "IN_MEMORY_SECRETS._update_secrets", "typing.cast", "typing.cast", "secret... | 0 | [] | The function (set_secrets) defined within the public class called public.The function start at line 112 and ends at 164. It contains 34 lines of code and it has a cyclomatic complexity of 10. The function does not take any parameters and does not return any value. It declares 21.0 functions, and It has 21.0 functions ... |
Sema4AI_actions | _CustomLifespan | protected | 0 | 0 | __init__ | def __init__(self) -> None:self._registered_lifespans: list[Callable[[FastAPI], AbstractAsyncContextManager[Never, bool | None]]] = [] | 1 | 4 | 1 | 32 | 0 | 17 | 20 | 17 | self | [] | None | {"AnnAssign": 1} | 0 | 4 | 0 | [] | 6,243 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec... | The function (__init__) defined within the protected class called _CustomLifespan.The function start at line 17 and ends at 20. 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 has 6243.0 functions calling this function whic... |
Sema4AI_actions | _CustomLifespan | protected | 0 | 0 | register | def register(self,lifespan: Callable[[FastAPI], AbstractAsyncContextManager[Never, bool | None]],) -> None:self._registered_lifespans.append(lifespan) | 1 | 5 | 2 | 34 | 0 | 22 | 26 | 22 | self,lifespan | [] | None | {"Expr": 1} | 1 | 5 | 1 | ["self._registered_lifespans.append"] | 904 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.integration.json.test_json_server_py.json_server", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.integration.test_error_handling_py.mock_server",... | The function (register) defined within the protected class called _CustomLifespan.The function start at line 22 and ends at 26. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [22.0] and does not return any value. It declare 1.0 function, It has 1.0 function ca... |
Sema4AI_actions | _CustomLifespan | protected | 0 | 0 | __call__ | async def __call__(self, main_app: FastAPI):from contextlib import AsyncExitStackasync with AsyncExitStack() as stack:for lifespan in self._registered_lifespans:await stack.enter_async_context(lifespan(main_app))yield | 2 | 6 | 2 | 39 | 0 | 29 | 35 | 29 | self,main_app | [] | None | {"Expr": 2, "For": 1} | 3 | 7 | 3 | ["AsyncExitStack", "stack.enter_async_context", "lifespan"] | 50 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3561509_collective_solgema_fullcalendar.Solgema.fullcalendar.browser.views_py.SolgemaFullcalendarEventJS.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3598540_saltstack_salt_testing.salttesting.runtests_p... | The function (__call__) defined within the protected class called _CustomLifespan.The function start at line 29 and ends at 35. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [29.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions... |
Sema4AI_actions | _CustomLifespan | protected | 0 | 0 | __init__ | def __init__(self, *args, **kwargs) -> None:custom_lifespan = _CustomLifespan()assert "lifespan" not in kwargskwargs["lifespan"] = custom_lifespansuper().__init__(*args, **kwargs)self.update_mtime_uuid()self.custom_lifespan = custom_lifespan | 1 | 7 | 3 | 51 | 0 | 41 | 48 | 41 | self | [] | None | {"AnnAssign": 1} | 0 | 4 | 0 | [] | 6,243 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.AlertCollector_py.AlertCollector.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.11269405_sapcc_vrops_exporter.collectors.ClusterAlertCollector_py.ClusterAlertCollec... | The function (__init__) defined within the protected class called _CustomLifespan.The function start at line 41 and ends at 48. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [41.0] and does not return any value. It has 6243.0 functions calling this function w... |
Sema4AI_actions | _CustomFastAPI | protected | 0 | 1 | update_mtime_uuid | def update_mtime_uuid(self) -> None:import uuidself.mtime_uuid: str = str(uuid.uuid4()) | 1 | 3 | 1 | 23 | 0 | 50 | 53 | 50 | self | [] | None | {"AnnAssign": 1} | 2 | 4 | 2 | ["str", "uuid.uuid4"] | 0 | [] | The function (update_mtime_uuid) defined within the protected class called _CustomFastAPI, that inherit another class.The function start at line 50 and ends at 53. 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.... |
Sema4AI_actions | _CustomFastAPI | protected | 0 | 1 | openapi | def openapi(self):"""As we're no longer using custom models for the routing APIs (instead ofpydantic or generated methods for the API, the body is directly queriedand interpreted as json and its schema validated), FastAPI is no longeradding the error references, so, we override the FastAPI.openapi()method to provide th... | 2 | 32 | 1 | 174 | 0 | 55 | 95 | 55 | self | [] | Returns | {"Assign": 5, "Expr": 1, "If": 1, "Return": 2} | 3 | 41 | 3 | ["FastAPI.openapi", "openapi.setdefault", "components.setdefault"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95255939_DIRACGrid_diracx.diracx_routers.src.diracx.routers.fastapi_classes_py.DiracFastAPI.openapi"] | The function (openapi) defined within the protected class called _CustomFastAPI, that inherit another class.The function start at line 55 and ends at 95. It contains 32 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 3.0 fun... |
Sema4AI_actions | public | public | 0 | 0 | get_app | def get_app() -> _CustomFastAPI:from sema4ai.action_server import __version__settings = get_settings()server = {"url": settings.server_url}app = _CustomFastAPI(title=settings.title,servers=[server],version=__version__,)app.add_middleware(CORSMiddleware,allow_origins=["*"],allow_methods=["*"],allow_headers=["*"],allow_c... | 1 | 21 | 0 | 120 | 3 | 99 | 125 | 99 | ['app', 'settings', 'server'] | _CustomFastAPI | {"Assign": 3, "Expr": 5, "Return": 1} | 7 | 27 | 7 | ["get_settings", "_CustomFastAPI", "app.add_middleware", "app.add_exception_handler", "app.add_exception_handler", "app.add_exception_handler", "app.add_exception_handler"] | 16 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3913818_randy3k_radian.radian.key_bindings_py.create_key_bindings", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3913818_randy3k_radian.radian.key_bindings_py.create_prompt_key_bindings", "_.content.gdrive.MyDrive.... | The function (get_app) defined within the public class called public.The function start at line 99 and ends at 125. It contains 21 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, It has 7.0 functions called inside... | |
Sema4AI_actions | public | public | 0 | 0 | ask_user_input_to_proceed | def ask_user_input_to_proceed(msg: str) -> bool:"""Args:msg: The message to query user (should end with something as: "(y/n)\n").Returns:True to proceed and False otherwise."""try:while (c := input(msg).lower().strip()) not in ("y", "n"):continueif c == "n":return False# otherwise 'y' keep on going...except KeyboardInt... | 4 | 9 | 1 | 52 | 0 | 10 | 27 | 10 | msg | [] | bool | {"Expr": 1, "If": 1, "Return": 3, "Try": 1, "While": 1} | 3 | 18 | 3 | ["strip", "lower", "input"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.package._package_build_cli_py.handle_package_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4a... | The function (ask_user_input_to_proceed) defined within the public class called public.The function start at line 10 and ends at 27. It contains 9 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 3.0 functions, It has 3.0 functio... |
Sema4AI_actions | public | public | 0 | 0 | ask_user_to_provide_access_credentials | def ask_user_to_provide_access_credentials() -> str:"""Returns:Control Room access credentials in valid form."""from sema4ai.action_server.vendored_deps.termcolors import bold_redwhile True:try:access_credentials = getpass("Enter Control Room access credentials: ")if access_credentials:_, _ = access_credentials.split("... | 4 | 20 | 0 | 70 | 1 | 30 | 54 | 30 | ['access_credentials'] | str | {"Assign": 2, "Expr": 3, "If": 1, "Return": 1, "Try": 1, "While": 1} | 6 | 25 | 6 | ["getpass", "access_credentials.split", "log.error", "bold_red", "log.error", "bold_red"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_cloud_py.handle_login_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_serve... | The function (ask_user_to_provide_access_credentials) defined within the public class called public.The function start at line 30 and ends at 54. It contains 20 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 6.0 functions, It h... | |
Sema4AI_actions | public | public | 0 | 0 | ask_user_to_choose_organization | def ask_user_to_choose_organization(organizations: typing.List[Organization],) -> str:"""Args:organizations: List of organizations with name and ID.Returns:Organization ID."""from sema4ai.action_server.vendored_deps.termcolors import bold_red, coloredfor index, name in enumerate([organization.name for organization in o... | 6 | 17 | 1 | 118 | 1 | 57 | 82 | 57 | organizations | ['choise'] | str | {"Assign": 1, "Expr": 4, "For": 1, "If": 1, "Return": 1, "Try": 1, "While": 1} | 10 | 26 | 10 | ["enumerate", "log.info", "colored", "int", "input", "len", "log.error", "bold_red", "log.error", "bold_red"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.package._package_build_cli_py.handle_package_command"] | The function (ask_user_to_choose_organization) defined within the public class called public.The function start at line 57 and ends at 82. It contains 17 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 10.0 functions, It has 10.... |
Sema4AI_actions | public | public | 0 | 0 | ask_user_for_hostname | def ask_user_for_hostname() -> str:"""Returns:Control Room hostname."""from urllib.parse import urlparsefrom sema4ai.action_server._storage import get_hostnamefrom sema4ai.action_server.vendored_deps.termcolors import bold_redwhile True:default_hostname = get_hostname()try:hostname = input(f"Enter Control Room hostname... | 5 | 18 | 0 | 92 | 3 | 85 | 109 | 85 | ['hostname', 'default_hostname', 'url'] | str | {"Assign": 3, "Expr": 3, "If": 2, "Return": 2, "Try": 1, "While": 1} | 7 | 25 | 7 | ["get_hostname", "input", "urlparse", "log.error", "bold_red", "log.error", "bold_red"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._actions_cloud_py.handle_login_command"] | The function (ask_user_for_hostname) defined within the public class called public.The function start at line 85 and ends at 109. It contains 18 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 7.0 functions, It has 7.0 functions... | |
Sema4AI_actions | public | public | 0 | 0 | add_datadir_arg | def add_datadir_arg(parser, defaults):parser.add_argument("-d","--datadir",metavar="PATH",default="",help=("Directory to store the data for operating the actions server ""(by default a datadir will be generated based on the current directory)."),) | 1 | 11 | 2 | 31 | 0 | 1 | 11 | 1 | parser,defaults | [] | None | {"Expr": 1} | 1 | 11 | 1 | ["parser.add_argument"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_helpers_py.add_data_args", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_im... | The function (add_datadir_arg) defined within the public class called public.The function start at line 1 and ends at 11. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1.0] and does not return any value. It declare 1.0 function, It has 1.0 function called i... |
Sema4AI_actions | public | public | 0 | 0 | add_data_args | def add_data_args(parser, defaults):add_datadir_arg(parser, defaults)parser.add_argument("--db-file",help=("The name of the database file, relative to the datadir ""(default: %(default)s)"),default=defaults["db_file"],) | 1 | 10 | 2 | 34 | 0 | 14 | 23 | 14 | parser,defaults | [] | None | {"Expr": 2} | 2 | 10 | 2 | ["add_datadir_arg", "parser.add_argument"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_datadir_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cl... | The function (add_data_args) defined within the public class called public.The function start at line 14 and ends at 23. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [14.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions calle... |
Sema4AI_actions | public | public | 0 | 0 | add_verbose_args | def add_verbose_args(parser, defaults):parser.add_argument("-v","--verbose",action="store_true",default=False,help="Be more talkative (default: %(default)s)",) | 1 | 8 | 2 | 28 | 0 | 26 | 33 | 26 | parser,defaults | [] | None | {"Expr": 1} | 1 | 8 | 1 | ["parser.add_argument"] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_cloud_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_... | The function (add_verbose_args) defined within the public class called public.The function start at line 26 and ends at 33. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [26.0] and does not return any value. It declare 1.0 function, It has 1.0 function called... |
Sema4AI_actions | public | public | 0 | 0 | add_login_args | def add_login_args(parser):parser.add_argument("-a","--access-credentials",type=str,help="Control Room access credentials",required=False,)parser.add_argument("--hostname", type=str, help="Hostname for the Control Room URL", required=False) | 1 | 11 | 1 | 44 | 0 | 36 | 46 | 36 | parser | [] | None | {"Expr": 2} | 2 | 11 | 2 | ["parser.add_argument", "parser.add_argument"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_cloud_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.packa... | The function (add_login_args) defined within the public class called public.The function start at line 36 and ends at 46. 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 2.0 functions, It has 2.0 functions called ... |
Sema4AI_actions | public | public | 0 | 0 | add_organization_args | def add_organization_args(parser):parser.add_argument("-o","--organization-id",type=str,help="Control Room organization ID",required=True,) | 1 | 8 | 1 | 26 | 0 | 49 | 56 | 49 | parser | [] | None | {"Expr": 1} | 1 | 8 | 1 | ["parser.add_argument"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.package._package_build_cli_py.add_package_command"] | The function (add_organization_args) defined within the public class called public.The function start at line 49 and ends at 56. 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 declare 1.0 function, It has 1.0 function call... |
Sema4AI_actions | public | public | 0 | 0 | add_push_package_args | def add_push_package_args(parser):parser.add_argument("-p","--package-path",type=str,help="Path to the uploaded package",required=True,) | 1 | 8 | 1 | 26 | 0 | 59 | 66 | 59 | parser | [] | None | {"Expr": 1} | 1 | 8 | 1 | ["parser.add_argument"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.package._package_build_cli_py.add_package_command"] | The function (add_push_package_args) defined within the public class called public.The function start at line 59 and ends at 66. 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 declare 1.0 function, It has 1.0 function call... |
Sema4AI_actions | public | public | 0 | 0 | add_package_args | def add_package_args(parser):parser.add_argument("-i","--package-id",type=str,help="Control Room action package ID",required=True,) | 1 | 8 | 1 | 26 | 0 | 69 | 76 | 69 | parser | [] | None | {"Expr": 1} | 1 | 8 | 1 | ["parser.add_argument"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3546011_hashdist_hashdist.hashdist.cli.frontend_cli_py.Build.setup", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.package._package_build_cli_py.add_p... | The function (add_package_args) defined within the public class called public.The function start at line 69 and ends at 76. 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 declare 1.0 function, It has 1.0 function called in... |
Sema4AI_actions | public | public | 0 | 0 | add_publish_args | def add_publish_args(parser):parser.add_argument("-c","--change-log",type=str,help="Changelog string for published package",required=True,) | 1 | 8 | 1 | 26 | 0 | 79 | 86 | 79 | parser | [] | None | {"Expr": 1} | 1 | 8 | 1 | ["parser.add_argument"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server.package._package_build_cli_py.add_package_command"] | The function (add_publish_args) defined within the public class called public.The function start at line 79 and ends at 86. 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 declare 1.0 function, It has 1.0 function called in... |
Sema4AI_actions | public | public | 0 | 0 | add_json_output_args | def add_json_output_args(parser):parser.add_argument("--json",help="Write output to stdout in json format",action="store_true",) | 1 | 6 | 1 | 20 | 0 | 89 | 94 | 89 | parser | [] | None | {"Expr": 1} | 1 | 6 | 1 | ["parser.add_argument"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_cloud_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_... | The function (add_json_output_args) defined within the public class called public.The function start at line 89 and ends at 94. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function calle... |
Sema4AI_actions | public | public | 0 | 0 | _add_skip_lint | def _add_skip_lint(parser, defaults):parser.add_argument("--skip-lint",default=False,help="Skip `@action` linting when an action is found (by default any ""`@action` is linted for errors when found).",action="store_true",) | 1 | 8 | 2 | 27 | 0 | 37 | 44 | 37 | parser,defaults | [] | None | {"Expr": 1} | 1 | 8 | 1 | ["parser.add_argument"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_import_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli... | The function (_add_skip_lint) defined within the public class called public.The function start at line 37 and ends at 44. It contains 8 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 declare 1.0 function, It has 1.0 function called i... |
Sema4AI_actions | public | public | 0 | 0 | _add_whitelist_args | def _add_whitelist_args(parser, defaults):parser.add_argument("--whitelist",default="",help="Allows whitelisting the actions/packages to be used",) | 1 | 6 | 2 | 22 | 0 | 47 | 52 | 47 | parser,defaults | [] | None | {"Expr": 1} | 1 | 6 | 1 | ["parser.add_argument"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_import_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli... | The function (_add_whitelist_args) defined within the public class called public.The function start at line 47 and ends at 52. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [47.0] and does not return any value. It declare 1.0 function, It has 1.0 function cal... |
Sema4AI_actions | public | public | 0 | 0 | str2bool | def str2bool(v):if isinstance(v, bool):return vif v.lower() in ("yes", "true", "t", "y", "1"):return Trueelif v.lower() in ("no", "false", "f", "n", "0"):return Falseelse:raise argparse.ArgumentTypeError("Boolean value expected.") | 4 | 9 | 1 | 66 | 0 | 55 | 63 | 55 | v | [] | Returns | {"If": 3, "Return": 3} | 4 | 9 | 4 | ["isinstance", "v.lower", "v.lower", "argparse.ArgumentTypeError"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77637574_alphagov_notifications_utils.notifications_utils.field_py.Placeholder.get_conditional_body", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77637574_alphagov_notifications_utils.tests.test_field_py.test_what... | The function (str2bool) defined within the public class called public.The function start at line 55 and ends at 63. It contains 9 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 4.0 functions, It has 4.0 functions called ins... |
Sema4AI_actions | public | public | 0 | 0 | _add_start_server_command | def _add_start_server_command(command_parser, defaults):from sema4ai.action_server._cli_helpers import add_data_args, add_verbose_argsstart_parser = command_parser.add_parser("start",help=("Starts the Sema4.ai Action Server (importing the actions in the ""current directory by default)."),)start_parser.add_argument("-a"... | 1 | 152 | 2 | 432 | 1 | 66 | 228 | 66 | command_parser,defaults | ['start_parser'] | None | {"Assign": 1, "Expr": 24} | 25 | 163 | 25 | ["command_parser.add_parser", "start_parser.add_argument", "start_parser.add_argument", "start_parser.add_argument", "start_parser.add_argument", "start_parser.add_argument", "start_parser.add_argument", "start_parser.add_argument", "start_parser.add_argument", "_add_skip_lint", "start_parser.add_argument", "start_pars... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_start_server_command) defined within the public class called public.The function start at line 66 and ends at 228. It contains 152 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [66.0] and does not return any value. It declares 25.0 functions, It has 25.0... |
Sema4AI_actions | public | public | 0 | 0 | _add_kill_lock_holder_args | def _add_kill_lock_holder_args(parser, defaults):parser.add_argument("--kill-lock-holder",action="store_true",help="Kill the process holding the data directory lock file if it exists.",default=False,) | 1 | 7 | 2 | 26 | 0 | 231 | 237 | 231 | parser,defaults | [] | None | {"Expr": 1} | 1 | 7 | 1 | ["parser.add_argument"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._add_datadir_command", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cl... | The function (_add_kill_lock_holder_args) defined within the public class called public.The function start at line 231 and ends at 237. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [231.0] and does not return any value. It declare 1.0 function, It has 1.0 fu... |
Sema4AI_actions | public | public | 0 | 0 | _add_migrate_command | def _add_migrate_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import add_data_args, add_verbose_argsmigration_parser = command_subparser.add_parser("migrate",help="Makes a database migration (if needed) and exits",)add_data_args(migration_parser, defaults)_add_kill_lock_holder_args(migra... | 1 | 9 | 2 | 48 | 1 | 240 | 249 | 240 | command_subparser,defaults | ['migration_parser'] | None | {"Assign": 1, "Expr": 3} | 4 | 10 | 4 | ["command_subparser.add_parser", "add_data_args", "_add_kill_lock_holder_args", "add_verbose_args"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_migrate_command) defined within the public class called public.The function start at line 240 and ends at 249. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [240.0] and does not return any value. It declares 4.0 functions, It has 4.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | _add_import_command | def _add_import_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import add_data_args, add_verbose_argsimport_parser = command_subparser.add_parser("import",help="Imports an Action Package and exits",)import_parser.add_argument("--dir",metavar="PATH",help="Can be used to import an action pac... | 1 | 17 | 2 | 79 | 1 | 252 | 270 | 252 | command_subparser,defaults | ['import_parser'] | None | {"Assign": 1, "Expr": 6} | 7 | 19 | 7 | ["command_subparser.add_parser", "import_parser.add_argument", "_add_skip_lint", "add_data_args", "_add_kill_lock_holder_args", "add_verbose_args", "_add_whitelist_args"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_import_command) defined within the public class called public.The function start at line 252 and ends at 270. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [252.0] and does not return any value. It declares 7.0 functions, It has 7.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | _add_devenv_command | def _add_devenv_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import add_datadir_arg, add_verbose_args# Ok, now add the `devenv` command. It should then have a# `task` subcommand which will receive the task name to run.devenv_parser = command_subparser.add_parser("devenv",help="Commands r... | 1 | 18 | 2 | 80 | 3 | 273 | 298 | 273 | command_subparser,defaults | ['devenv_parser', 'task_parser', 'devenv_subparsers'] | None | {"Assign": 3, "Expr": 3} | 6 | 26 | 6 | ["command_subparser.add_parser", "devenv_parser.add_subparsers", "add_datadir_arg", "add_verbose_args", "devenv_subparsers.add_parser", "task_parser.add_argument"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_devenv_command) defined within the public class called public.The function start at line 273 and ends at 298. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [273.0] and does not return any value. It declares 6.0 functions, It has 6.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | _add_new_command | def _add_new_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import (add_json_output_args,add_verbose_args,)new_parser = command_subparser.add_parser("new",help="Bootstrap new project from template",)new_parser.add_argument("--name",help="Name for the project",)new_parser.add_argument("--te... | 1 | 29 | 2 | 108 | 3 | 301 | 337 | 301 | command_subparser,defaults | ['new_subparsers', 'list_templates_parser', 'new_parser'] | None | {"Assign": 3, "Expr": 6} | 9 | 37 | 9 | ["command_subparser.add_parser", "new_parser.add_argument", "new_parser.add_argument", "new_parser.add_argument", "add_verbose_args", "new_parser.add_subparsers", "new_subparsers.add_parser", "add_verbose_args", "add_json_output_args"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_new_command) defined within the public class called public.The function start at line 301 and ends at 337. It contains 29 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [301.0] and does not return any value. It declares 9.0 functions, It has 9.0 functions... |
Sema4AI_actions | public | public | 0 | 0 | _add_cloud_command | def _add_cloud_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import (add_json_output_args,add_login_args,add_verbose_args,)cloud_parser = command_subparser.add_parser("cloud",help="Utilities to perform Control Room operations",)cloud_subparsers = cloud_parser.add_subparsers(dest="cloud_co... | 1 | 28 | 2 | 111 | 5 | 340 | 372 | 340 | command_subparser,defaults | ['list_organizations_parser', 'login_parser', 'verify_login_parser', 'cloud_parser', 'cloud_subparsers'] | None | {"Assign": 5, "Expr": 6} | 11 | 33 | 11 | ["command_subparser.add_parser", "cloud_parser.add_subparsers", "cloud_subparsers.add_parser", "add_login_args", "add_verbose_args", "cloud_subparsers.add_parser", "add_json_output_args", "cloud_subparsers.add_parser", "add_json_output_args", "add_login_args", "add_verbose_args"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_cloud_command) defined within the public class called public.The function start at line 340 and ends at 372. It contains 28 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [340.0] and does not return any value. It declares 11.0 functions, It has 11.0 funct... |
Sema4AI_actions | public | public | 0 | 0 | _add_oauth2_command | def _add_oauth2_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import add_json_output_argsoauth2_parser = command_subparser.add_parser("oauth2",help="Utilities to manage the OAuth2 configuration",)oauth2_subparsers = oauth2_parser.add_subparsers(dest="oauth2_command")oauth2_subparsers.add_... | 1 | 15 | 2 | 65 | 3 | 375 | 394 | 375 | command_subparser,defaults | ['user_config_path_parser', 'oauth2_parser', 'oauth2_subparsers'] | None | {"Assign": 3, "Expr": 2} | 5 | 20 | 5 | ["command_subparser.add_parser", "oauth2_parser.add_subparsers", "oauth2_subparsers.add_parser", "oauth2_subparsers.add_parser", "add_json_output_args"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_oauth2_command) defined within the public class called public.The function start at line 375 and ends at 394. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [375.0] and does not return any value. It declares 5.0 functions, It has 5.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | _add_datadir_command | def _add_datadir_command(command_subparser, defaults):from sema4ai.action_server._cli_helpers import add_data_args, add_verbose_argsdatadir_parser = command_subparser.add_parser("datadir",help="Commands related to the datadir handling",)datadir_subparser = datadir_parser.add_subparsers(dest="datadir_command")clear_acti... | 1 | 14 | 2 | 71 | 3 | 397 | 414 | 397 | command_subparser,defaults | ['clear_actions_parser', 'datadir_parser', 'datadir_subparser'] | None | {"Assign": 3, "Expr": 3} | 6 | 18 | 6 | ["command_subparser.add_parser", "datadir_parser.add_subparsers", "datadir_subparser.add_parser", "add_data_args", "_add_kill_lock_holder_args", "add_verbose_args"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._create_parser"] | The function (_add_datadir_command) defined within the public class called public.The function start at line 397 and ends at 414. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [397.0] and does not return any value. It declares 6.0 functions, It has 6.0 funct... |
Sema4AI_actions | public | public | 0 | 0 | _create_parser | def _create_parser():from sema4ai.action_server.package._package_build_cli import add_package_commandfrom ._settings import Settingsdefaults = Settings.defaults()base_parser = argparse.ArgumentParser(prog="action-server",description=f"Sema4.ai Action Server ({__version__})",formatter_class=argparse.RawTextHelpFormatter... | 1 | 46 | 0 | 196 | 6 | 417 | 499 | 417 | ['rcc_parser', 'defaults', 'env_parser', 'command_subparser', 'env_subparser', 'base_parser'] | Returns | {"Assign": 7, "Expr": 11, "Return": 1} | 18 | 83 | 18 | ["Settings.defaults", "argparse.ArgumentParser", "base_parser.add_subparsers", "_add_start_server_command", "_add_import_command", "command_subparser.add_parser", "rcc_parser.add_argument", "_add_new_command", "command_subparser.add_parser", "_add_migrate_command", "add_package_command", "command_subparser.add_parser",... | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._main_retcode", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.tests.action_server_tests.test_cli_p... | The function (_create_parser) defined within the public class called public.The function start at line 417 and ends at 499. It contains 46 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 18.0 functions, It has 18.0 functions... | |
Sema4AI_actions | public | public | 0 | 0 | _setup_global_logging | def _setup_global_logging():# Always disable the debug for requests oauthlib (as it'll print# refresh token information).logging.getLogger("requests_oauthlib").setLevel(logging.INFO) | 1 | 2 | 0 | 17 | 0 | 502 | 505 | 502 | [] | None | {"Expr": 1} | 2 | 4 | 2 | ["setLevel", "logging.getLogger"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._main_retcode"] | The function (_setup_global_logging) defined within the public class called public.The function start at line 502 and ends at 505. 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, It has 2.0 functions... | |
Sema4AI_actions | public | public | 0 | 0 | _setup_stderr_logging | def _setup_stderr_logging(log_level):from logging import StreamHandlerfrom sema4ai.action_server._robo_utils.log_formatter import (UvicornAccessDisableOAuth2LogFilter,)# stderr is the default, but make it explicit.stream_handler = StreamHandler(sys.stderr)stream_handler.setLevel(log_level)if log_level == logging.DEBUG:... | 2 | 21 | 1 | 118 | 3 | 508 | 533 | 508 | log_level | ['stream_handler', 'formatter', 'logger'] | None | {"Assign": 5, "Expr": 5, "If": 1} | 10 | 26 | 10 | ["StreamHandler", "stream_handler.setLevel", "logging.Formatter", "FormatterStdout", "stream_handler.addFilter", "UvicornLogFilter", "stream_handler.addFilter", "UvicornAccessDisableOAuth2LogFilter", "stream_handler.setFormatter", "logger.addHandler"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._main_retcode"] | The function (_setup_stderr_logging) defined within the public class called public.The function start at line 508 and ends at 533. It contains 21 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 10.0 functions, It has 10.0 functi... |
Sema4AI_actions | public | public | 0 | 0 | _setup_logging | def _setup_logging(datadir: Path, log_level):from logging.handlers import RotatingFileHandlerfrom sema4ai.action_server._robo_utils.log_formatter import (UvicornAccessDisableOAuth2LogFilter,)from ._robo_utils.log_formatter import FormatterNoColorlog_file = str(datadir / "server_log.txt")log.info(colored(f"Logs may be f... | 1 | 20 | 2 | 115 | 3 | 536 | 558 | 536 | datadir,log_level | ['rotating_handler', 'log_file', 'logger'] | None | {"Assign": 3, "Expr": 5} | 10 | 23 | 10 | ["str", "log.info", "colored", "RotatingFileHandler", "rotating_handler.addFilter", "UvicornAccessDisableOAuth2LogFilter", "rotating_handler.setLevel", "rotating_handler.setFormatter", "FormatterNoColor", "logger.addHandler"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953430_aws_aws_encryption_sdk_python.decrypt_oracle._chalice.pipeline_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053458_Sema4AI_actions.action_server.src.sema4ai.action_server._cli_impl_py._command_r... | The function (_setup_logging) defined within the public class called public.The function start at line 536 and ends at 558. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [536.0] and does not return any value. It declares 10.0 functions, It has 10.0 functions... |
Sema4AI_actions | public | public | 0 | 0 | _import_actions | def _import_actions(base_args: ArgumentsNamespaceBaseImportOrStart,settings: "Settings",disable_not_imported: bool,) -> int:"""Args:base_args: The base arguments collected from the cli input.settings: The settings for the action server.disable_not_imported: Whether actions which were not imported should be disabled.Ret... | 4 | 25 | 3 | 103 | 0 | 561 | 597 | 561 | base_args,settings,disable_not_imported | [] | int | {"Assign": 1, "Expr": 3, "For": 1, "If": 1, "Return": 2, "Try": 1} | 4 | 37 | 4 | ["_actions_import.import_action_package", "os.path.abspath", "log.critical", "bold_red"] | 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.action_server.src.sema4ai.action_serv... | The function (_import_actions) defined within the public class called public.The function start at line 561 and ends at 597. It contains 25 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [561.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions ... |
Sema4AI_actions | public | public | 0 | 0 | _get_log_level | def _get_log_level(base_args):verbose = getattr(base_args, "verbose", False)log_level = logging.DEBUG if verbose else logging.INFOreturn log_level | 2 | 4 | 1 | 28 | 2 | 600 | 603 | 600 | base_args | ['verbose', 'log_level'] | Returns | {"Assign": 2, "Return": 1} | 1 | 4 | 1 | ["getattr"] | 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.action_server.src.sema4ai.action_serv... | The function (_get_log_level) defined within the public class called public.The function start at line 600 and ends at 603. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0 function calle... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.