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
aiondemand_AIOD-rest-api
ResourceWithRelations
public
0
1
__post_init__
def __post_init__(self):"""Raise an error if there is a mismatch between the datatype of a related resource,and the datatype of the corresponding field. For example, for Dataset.creator,the datatype is list[Contact] according to the annotations. Therefore, related resourceswith the key "creator" should be of datetype "...
6
18
1
91
0
25
53
25
self
[]
None
{"Assign": 5, "Expr": 1, "For": 2, "If": 2}
6
29
6
["self.related_resources.items", "datatype_of_field", "isinstance", "isinstance", "type", "ValueError"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3953269_alisaifee_flask_limiter.flask_limiter._limits_py.RouteLimit.__post_init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.88805393_amisadmin_fastapi_amis_admin.fastapi_amis_admin.admin.extensions.schemas_py....
The function (__post_init__) defined within the public class called ResourceWithRelations, that inherit another class.The function start at line 25 and ends at 53. It contains 18 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 6...
aiondemand_AIOD-rest-api
public
public
0
0
_parse_args
def _parse_args() -> argparse.Namespace:parser = argparse.ArgumentParser(description="Synchronize a resource from a platform to the AIoD database.")parser.add_argument("-c","--connector",required=True,help="The connector to use. Please provide a relative path such as ""'connectors.zenodo.zenodo_dataset_connector.Zenodo...
1
54
0
159
1
28
81
28
['parser']
argparse.Namespace
{"Assign": 1, "Expr": 7, "Return": 1}
10
54
10
["argparse.ArgumentParser", "parser.add_argument", "parser.add_argument", "parser.add_argument", "parser.add_argument", "datetime.strptime", "parser.add_argument", "parser.add_argument", "parser.add_argument", "parser.parse_args"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3717448_jendrikseipp_vulture.tests.test_config_py.test_cli_args", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3717448_jendrikseipp_vulture.vulture.config_py.make_config", "_.content.gdrive.MyDrive.Phd_Thesis.Datas...
The function (_parse_args) defined within the public class called public.The function start at line 28 and ends at 81. It contains 54 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions, It has 10.0 functions called i...
aiondemand_AIOD-rest-api
public
public
0
0
exception_handler
def exception_handler(exc_type, exc_value, exc_traceback):logging.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback))
1
2
3
25
0
84
85
84
exc_type,exc_value,exc_traceback
[]
None
{"Expr": 1}
1
2
1
["logging.error"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94719596_openfoodfacts_open_prices.open_prices.common.middleware_py.custom_exception_handler"]
The function (exception_handler) defined within the public class called public.The function start at line 84 and ends at 85. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [84.0] and does not return any value. It declare 1.0 function, It has 1.0 function calle...
aiondemand_AIOD-rest-api
public
public
0
0
save_to_database
def save_to_database(session: Session,connector: ResourceConnector,router: ResourceRouter,item: RESOURCE | ResourceWithRelations[RESOURCE] | RecordError,user,) -> Optional[RecordError]:if isinstance(item, RecordError):return itemtry:if isinstance(item, ResourceWithRelations):resource_create_instance = item.resource_cre...
8
33
5
177
4
88
122
88
session,connector,router,item,user
['resource_create_instance', 'id_', 'existing', 'resource']
Optional[RecordError]
{"Assign": 8, "Expr": 4, "If": 6, "Return": 3, "Try": 1}
12
35
12
["isinstance", "isinstance", "_create_or_fetch_related_objects", "_get_existing_resource", "router.create_resource", "publish_resource", "session.rollback", "isinstance", "isinstance", "isinstance", "RecordError", "session.flush"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.synchronization_py.main"]
The function (save_to_database) defined within the public class called public.The function start at line 88 and ends at 122. It contains 33 lines of code and it has a cyclomatic complexity of 8. It takes 5 parameters, represented as [88.0] and does not return any value. It declares 12.0 functions, It has 12.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
_create_or_fetch_related_objects
def _create_or_fetch_related_objects(session: Session, item: ResourceWithRelations):"""For all resources in the `related_resources`, get the identifier, by eitherinserting them in the database, or retrieving the existing values, and put the identifiersinto the item.resource.[field_name]"""for field_name, related_resour...
11
31
2
197
5
125
166
125
session,item
['identifiers', 'created_resource', 'existing', 'resources', 'resource_read_str']
None
{"Assign": 8, "Expr": 6, "For": 2, "If": 4}
12
42
12
["item.related_resources.items", "isinstance", "type", "resource_read_str.startswith", "_get_existing_resource", "router.create_resource", "publish_resource", "identifiers.append", "identifiers.append", "isinstance", "item.resource.__setattr__", "item.resource.__setattr__"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.synchronization_py.save_to_database"]
The function (_create_or_fetch_related_objects) defined within the public class called public.The function start at line 125 and ends at 166. It contains 31 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [125.0] and does not return any value. It declares 12.0 functions, It...
aiondemand_AIOD-rest-api
public
public
0
0
publish_resource
def publish_resource(session: Session, item: AIoDConcept):if hasattr(item, "aiod_entry"):item.aiod_entry.status = EntryStatus.PUBLISHEDsession.add(item)session.commit()return item
2
6
2
41
0
169
174
169
session,item
[]
Returns
{"Assign": 1, "Expr": 2, "If": 1, "Return": 1}
3
6
3
["hasattr", "session.add", "session.commit"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.synchronization_py._create_or_fetch_related_objects", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.synchronization_p...
The function (publish_resource) defined within the public class called public.The function start at line 169 and ends at 174. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [169.0], and this function return a value. It declares 3.0 functions, It has 3.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
main.is_connector
def is_connector(self) -> bool:return True
1
2
1
9
0
224
225
224
null
[]
None
null
0
0
0
null
0
null
The function (main.is_connector) defined within the public class called public.The function start at line 224 and ends at 225. 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..
aiondemand_AIOD-rest-api
public
public
0
0
main.is_connector_for_platform
def is_connector_for_platform(self, platform: str) -> bool:return platform == connector.platform_name
1
2
2
17
0
227
228
227
null
[]
None
null
0
0
0
null
0
null
The function (main.is_connector_for_platform) defined within the public class called public.The function start at line 227 and ends at 228. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [227.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
main
def main():args = _parse_args()setup_logger()sys.excepthook = exception_handlermodule_path = ".".join(args.connector.split(".")[0:-1])connector_cls_name = args.connector.split(".")[-1]module = importlib.import_module(module_path)connector: ResourceConnector = getattr(module, connector_cls_name)()working_dir = pathlib.P...
17
65
0
483
13
177
254
177
['error_cleaned', 'args', 'db_empty', 'module_path', 'connector_cls_name', 'state_path', 'first_run', 'items', 'state', 'error_path', 'working_dir', 'module', 'error']
Returns
{"AnnAssign": 1, "Assign": 16, "Expr": 13, "For": 1, "If": 6, "Return": 2, "With": 6}
42
78
42
["_parse_args", "setup_logger", "join", "args.connector.split", "args.connector.split", "importlib.import_module", "getattr", "pathlib.Path", "working_dir.exists", "state_path.unlink", "error_path.unlink", "working_dir.mkdir", "state_path.exists", "DbSession", "first", "session.scalars", "select", "state_path.unlink", ...
332
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.main_py.init", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3625043_uber_tchannel_python.tests.test_tcurl_py.test_tcurl_health", "_.content.gdrive.MyDrive.Phd_Thesis...
The function (main) defined within the public class called public.The function start at line 177 and ends at 254. It contains 65 lines of code and it has a cyclomatic complexity of 17. The function does not take any parameters, and this function return a value. It declares 42.0 functions, It has 42.0 functions called i...
aiondemand_AIOD-rest-api
ResourceConnector
public
1
1
resource_class
def resource_class(self) -> type[RESOURCE]:"""The resource class that this connector fetches. E.g. Dataset."""
1
1
1
11
0
24
25
24
self
[]
type[RESOURCE]
{"Expr": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called ResourceConnector, implement an interface, and it inherit another class.The function start at line 24 and ends at 25. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return an...
aiondemand_AIOD-rest-api
ResourceConnector
public
1
1
platform_name
def platform_name(self) -> PlatformName:"""The platform of this connector."""
1
1
1
8
0
29
30
29
self
[]
PlatformName
{"Expr": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called ResourceConnector, implement an interface, and it inherit another class.The function start at line 29 and ends at 30. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any...
aiondemand_AIOD-rest-api
ResourceConnector
public
1
1
run
def run(self, state: dict, **kwargs) -> Iterator[SQLModel | ResourceWithRelations[SQLModel] | RecordError]:"""Fetch resources and update the state"""
1
3
3
25
0
33
36
33
self,state,**kwargs
[]
Iterator[SQLModel | ResourceWithRelations[SQLModel] | RecordError]
{"Expr": 1}
0
4
0
[]
668
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_directories", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_project_to_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation...
The function (run) defined within the public class called ResourceConnector, implement an interface, and it inherit another class.The function start at line 33 and ends at 36. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [33.0] and does not return any value....
aiondemand_AIOD-rest-api
ResourceConnectorByDate
public
0
1
retry
def retry(self, _id: int) -> RESOURCE | ResourceWithRelations[RESOURCE] | RecordError:"""Retrieve information of the resource identified by id"""
1
1
2
19
0
20
21
20
self,_id
[]
RESOURCE | ResourceWithRelations[RESOURCE] | RecordError
{"Expr": 1}
0
2
0
[]
51
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py._store_git_repos", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py.build_wheel", "_.content.gdriv...
The function (retry) defined within the public class called ResourceConnectorByDate, that inherit another class.The function start at line 20 and ends at 21. It contains 1 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [20.0] and does not return any value. It has 51.0 funct...
aiondemand_AIOD-rest-api
ResourceConnectorByDate
public
0
1
fetch
def fetch(self, from_incl: datetime, to_excl: datetime) -> Iterator[Tuple[datetime | None, RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]]:"""Retrieve information of all resources"""
1
3
3
33
0
24
27
24
self,from_incl,to_excl
[]
Iterator[Tuple[datetime | None, RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]]
{"Expr": 1}
0
4
0
[]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called ResourceConnectorByDate, that inherit another class.The function start at line 24 and ends at 27. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [24.0] and does not return any value. It has 21.0 funct...
aiondemand_AIOD-rest-api
ResourceConnectorByDate
public
0
1
run
def run(self,state: dict,limit: int | None = None,from_incl: datetime | None = None,to_excl: datetime | None = None,time_per_loop: timedelta = timedelta(days=1),**kwargs,) -> Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]:if limit is not None:raise ValueError("Limit not implemented for this connecto...
11
42
6
310
0
29
73
29
self,state,limit,from_incl,to_excl,time_per_loop,**kwargs
[]
Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]
{"Assign": 13, "Expr": 3, "For": 1, "If": 5, "While": 1}
18
45
18
["timedelta", "ValueError", "logging.warning", "to_excl.replace", "replace", "datetime.utcnow", "ValueError", "from_incl.replace", "replace", "datetime.utcfromtimestamp", "min", "logging.info", "from_incl.timestamp", "to_excl_current.timestamp", "self.fetch", "datetime_.timestamp", "replace", "datetime.utcfromtimestamp...
668
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_directories", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_project_to_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation...
The function (run) defined within the public class called ResourceConnectorByDate, that inherit another class.The function start at line 29 and ends at 73. It contains 42 lines of code and it has a cyclomatic complexity of 11. It takes 6 parameters, represented as [29.0] and does not return any value. It declares 18.0 ...
aiondemand_AIOD-rest-api
ResourceConnectorById
public
0
1
__init__
def __init__(self, limit_per_iteration: int = 500):self.limit_per_iteration = limit_per_iteration
1
2
2
16
0
15
16
15
self,limit_per_iteration
[]
None
{"Assign": 1}
0
2
0
[]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ResourceConnectorById, that inherit another class.The function start at line 15 and ends at 16. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [15.0] and does not return any value. It has 8182.0 fu...
aiondemand_AIOD-rest-api
ResourceConnectorById
public
0
1
retry
def retry(self, identifier: int) -> RESOURCE | ResourceWithRelations[RESOURCE] | RecordError:"""Retrieve information of the resource identified by id"""
1
1
2
19
0
19
20
19
self,identifier
[]
RESOURCE | ResourceWithRelations[RESOURCE] | RecordError
{"Expr": 1}
0
2
0
[]
51
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py._store_git_repos", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py.build_wheel", "_.content.gdriv...
The function (retry) defined within the public class called ResourceConnectorById, that inherit another class.The function start at line 19 and ends at 20. It contains 1 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [19.0] and does not return any value. It has 51.0 functio...
aiondemand_AIOD-rest-api
ResourceConnectorById
public
0
1
fetch
def fetch(self, offset: int, from_identifier: int) -> Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]:"""Retrieve information of resources"""
1
3
3
26
0
23
26
23
self,offset,from_identifier
[]
Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]
{"Expr": 1}
0
4
0
[]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called ResourceConnectorById, that inherit another class.The function start at line 23 and ends at 26. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [23.0] and does not return any value. It has 21.0 functio...
aiondemand_AIOD-rest-api
ResourceConnectorById
public
0
1
run
def run(self, state: dict, from_identifier: int | None = None, limit: int | None = None, **kwargs) -> Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]:if limit is not None:logging.warning("Limiting the results! Please remove the limit command line argument in production.")first_run = not state# Settin...
17
45
5
265
0
28
81
28
self,state,from_identifier,limit,**kwargs
[]
Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]
{"Assign": 14, "AugAssign": 3, "Expr": 5, "For": 1, "If": 9, "Return": 2, "While": 1}
10
54
10
["logging.warning", "ValueError", "logging.info", "self.fetch", "isinstance", "isinstance", "isinstance", "isinstance", "int", "logging.info"]
668
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_directories", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_project_to_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation...
The function (run) defined within the public class called ResourceConnectorById, that inherit another class.The function start at line 28 and ends at 81. It contains 45 lines of code and it has a cyclomatic complexity of 17. It takes 5 parameters, represented as [28.0] and does not return any value. It declares 10.0 fu...
aiondemand_AIOD-rest-api
ResourceConnectorOnStartUp
public
0
1
fetch
def fetch(self, limit: int | None = None) -> Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]:"""Retrieve information of all resources"""
1
3
2
26
0
15
18
15
self,limit
[]
Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]
{"Expr": 1}
0
4
0
[]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called ResourceConnectorOnStartUp, that inherit another class.The function start at line 15 and ends at 18. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [15.0] and does not return any value. It has 21.0 fu...
aiondemand_AIOD-rest-api
ResourceConnectorOnStartUp
public
0
1
run
def run(self, state: dict, limit: int | None = None, **kwargs) -> Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]:if state:logging.warning("This connector has run before. Exiting.")returnif limit is not None:logging.warning("Limiting the results! Please remove the limit command line argument in produ...
3
13
4
77
0
20
32
20
self,state,limit,**kwargs
[]
Iterator[RESOURCE | ResourceWithRelations[RESOURCE] | RecordError]
{"Assign": 2, "Expr": 3, "If": 2, "Return": 1}
4
13
4
["logging.warning", "logging.warning", "datetime.datetime.now", "self.fetch"]
668
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_directories", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508273_sc3_cookcountyjail.fabfile_py.add_project_to_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation...
The function (run) defined within the public class called ResourceConnectorOnStartUp, that inherit another class.The function start at line 20 and ends at 32. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [20.0] and does not return any value. It declares 4.0...
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
__init__
def __init__(self, token=TOKEN):self.token = tokenif self.token == "":raise ValueError("You need to asign a value to AIBUILDER_API_TOKEN environment variable.")
2
6
2
26
0
48
53
48
self,token
[]
None
{"Assign": 1, "If": 1}
1
6
1
["ValueError"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 48 and ends at 53. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [48.0] and does not return any value. It declare 1...
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
resource_class
def resource_class(self) -> type[MLModel]:return MLModel
1
2
1
12
0
56
57
56
self
[]
type[MLModel]
{"Return": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 56 and ends at 57. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
platform_name
def platform_name(self) -> PlatformName:return PlatformName.aibuilder
1
2
1
11
0
60
61
60
self
[]
PlatformName
{"Return": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 60 and ends at 61. 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..
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
retry
def retry(self, identifier: int) -> ResourceWithRelations[MLModel] | RecordError:raise NotImplementedError("Not implemented.")
1
2
2
21
0
63
64
63
self,identifier
[]
ResourceWithRelations[MLModel] | RecordError
{}
1
2
1
["NotImplementedError"]
51
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py._store_git_repos", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py.build_wheel", "_.content.gdriv...
The function (retry) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 63 and ends at 64. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [63.0] and does not return any value. It declare 1.0 ...
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
get_response
def get_response(self, url) -> dict | list | RecordError:"""Performs the `url` request checking for correctness and returns the`list` or `dict`structure received or a `RecordError`."""try:response = requests.get(url, timeout=REQUEST_TIMEOUT)except Exception as e:return RecordError(identifier=None, error=e)if response.s...
4
17
2
110
0
69
89
69
self,url
[]
dict | list | RecordError
{"Assign": 6, "Expr": 2, "If": 2, "Return": 3, "Try": 1}
8
21
8
["requests.get", "RecordError", "response.json", "logging.error", "HTTPError", "RecordError", "limits", "limits"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3689214_zowe_zowe_client_python_sdk.tests.unit.test_zos_console_py.TestConsoleClass.test_get_response_should_return_messages", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3719314_idlesign_django_sitetree.demo.demo...
The function (get_response) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 69 and ends at 89. It contains 17 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [69.0] and does not return any value. It decl...
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
_is_aware
def _is_aware(self, date):"""Returns True if `date` is a timezone-aware `datetime`."""return date.tzinfo is not None and date.tzinfo.utcoffset(date) is not None
2
2
2
27
0
91
93
91
self,date
[]
Returns
{"Expr": 1, "Return": 1}
1
3
1
["date.tzinfo.utcoffset"]
0
[]
The function (_is_aware) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 91 and ends at 93. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [91.0], and this function return a value. It decl...
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
_mlmodel_from_solution
def _mlmodel_from_solution(self, solution: dict, id: str, url: str) -> ResourceWithRelations[MLModel] | RecordError:"""Generates an fills a `ResourceWithRelations` object with the `MlModel`attributes received in a `dict`."""if not set(mlmodel_mapping.values()) <= set(solution.keys()):err_msg = "Bad structure on the rec...
17
74
4
463
0
95
192
95
self,solution,id,url
[]
ResourceWithRelations[MLModel] | RecordError
{"Assign": 29, "Expr": 1, "If": 14, "Return": 5}
29
98
29
["set", "mlmodel_mapping.values", "set", "solution.keys", "RecordError", "mlmodel_mapping.keys", "RecordError", "RecordError", "mlmodel_mapping.keys", "RecordError", "mlmodel_mapping.keys", "mlmodel_mapping.keys", "mlmodel_mapping.keys", "_description_format", "mlmodel_mapping.keys", "_distribution_format", "mlmodel_ma...
0
[]
The function (_mlmodel_from_solution) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 95 and ends at 192. It contains 74 lines of code and it has a cyclomatic complexity of 17. It takes 4 parameters, represented as [95.0] and does not return any va...
aiondemand_AIOD-rest-api
AIBuilderMLModelConnector
public
0
1
fetch
def fetch(self, from_incl: datetime, to_excl: datetime) -> Iterator[Tuple[datetime | None, MLModel | ResourceWithRelations[MLModel] | RecordError]]:"""It fetches the entire list of catalogs and, for each catalog, the entire list of solutions.Then it filters by date and fetches every solution within [`from_incl`, `to_ex...
19
75
3
475
0
194
283
194
self,from_incl,to_excl
[]
Iterator[Tuple[datetime | None, MLModel | ResourceWithRelations[MLModel] | RecordError]]
{"Assign": 21, "Expr": 10, "For": 2, "If": 7, "Return": 3, "Try": 3}
31
90
31
["self._is_aware", "from_incl.replace", "self._is_aware", "to_excl.replace", "self.get_response", "isinstance", "RecordError", "len", "RecordError", "enumerate", "self.get_response", "isinstance", "len", "datetime.fromisoformat", "len", "RecordError", "len", "len", "RecordError", "enumerate", "self.get_response", "isin...
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called AIBuilderMLModelConnector, that inherit another class.The function start at line 194 and ends at 283. It contains 75 lines of code and it has a cyclomatic complexity of 19. It takes 3 parameters, represented as [194.0] and does not return any value. It declare...
aiondemand_AIOD-rest-api
public
public
0
0
_description_format
def _description_format(description: str) -> Text:"""Generates a `Text` class with a plain text description from a `str`."""if not description:description = ""if len(description) > field_length.LONG:text_break = " [...]"description = description[: field_length.LONG - len(text_break)] + text_breakreturn Text(plain=descr...
3
7
1
53
2
286
293
286
description
['text_break', 'description']
Text
{"Assign": 3, "Expr": 1, "If": 2, "Return": 1}
3
8
3
["len", "len", "Text"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.aibuilder.aibuilder_mlmodel_connector_py.AIBuilderMLModelConnector._mlmodel_from_solution"]
The function (_description_format) defined within the public class called public.The function start at line 286 and ends at 293. It contains 7 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 c...
aiondemand_AIOD-rest-api
public
public
0
0
_distribution_format
def _distribution_format(distribution) -> list[RunnableDistribution]:return []
1
2
1
13
0
297
298
297
distribution
[]
list[RunnableDistribution]
{"Return": 1}
0
2
0
[]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.aibuilder.aibuilder_mlmodel_connector_py.AIBuilderMLModelConnector._mlmodel_from_solution"]
The function (_distribution_format) defined within the public class called public.The function start at line 297 and ends at 298. 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 has 1.0 function calling this function which ...
aiondemand_AIOD-rest-api
public
public
0
0
_as_list
def _as_list(value: Any | list[Any]) -> list[Any]:"""Wrap it with a list, if it is not a list"""if not value:return []if not isinstance(value, list):return [value]return value
3
6
1
40
0
301
307
301
value
[]
list[Any]
{"Expr": 1, "If": 2, "Return": 3}
1
7
1
["isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.aibuilder.aibuilder_mlmodel_connector_py.AIBuilderMLModelConnector._mlmodel_from_solution", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_res...
The function (_as_list) defined within the public class called public.The function start at line 301 and ends at 307. 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 declare 1.0 function, It has 1.0 function called inside w...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
24
26
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 24 and ends at 26. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
30
32
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 30 and ends at 32. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
36
38
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 36 and ends at 38. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
42
44
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 42 and ends at 44. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
48
50
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 48 and ends at 50. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
54
56
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 54 and ends at 56. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
60
62
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 60 and ends at 62. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
66
68
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 66 and ends at 68. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
72
74
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 72 and ends at 74. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
78
80
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 78 and ends at 80. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
84
86
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 84 and ends at 86. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
90
92
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 90 and ends at 92. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
96
98
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 96 and ends at 98. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
102
104
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 102 and ends at 104. 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...
aiondemand_AIOD-rest-api
ExampleCaseStudyConnector
public
0
1
__init__
def __init__(self):json_path = RESOURCE_PATH / "case_studies.json"super().__init__(json_path, CaseStudy)
1
3
1
20
0
108
110
24
self
[]
None
{"Assign": 1, "Expr": 1}
2
3
2
["__init__", "super"]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleCaseStudyConnector, that inherit another class.The function start at line 108 and ends at 110. 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...
aiondemand_AIOD-rest-api
ExampleConnector
public
0
1
__init__
def __init__(self, json_path: pathlib.Path, resource_class: type[RESOURCE]):self.json_path = json_pathself._resource_class = resource_class
1
3
3
28
0
20
22
20
self,json_path,resource_class
[]
None
{"Assign": 2}
0
3
0
[]
8,182
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi...
The function (__init__) defined within the public class called ExampleConnector, that inherit another class.The function start at line 20 and ends at 22. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [20.0] and does not return any value. It has 8182.0 functio...
aiondemand_AIOD-rest-api
ExampleConnector
public
0
1
resource_class
def resource_class(self) -> type[RESOURCE]:return self._resource_class
1
2
1
14
0
25
26
25
self
[]
type[RESOURCE]
{"Return": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called ExampleConnector, that inherit another class.The function start at line 25 and ends at 26. 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..
aiondemand_AIOD-rest-api
ExampleConnector
public
0
1
platform_name
def platform_name(self) -> PlatformName:return PlatformName.example
1
2
1
11
0
29
30
29
self
[]
PlatformName
{"Return": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called ExampleConnector, that inherit another class.The function start at line 29 and ends at 30. 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..
aiondemand_AIOD-rest-api
ExampleConnector
public
0
1
fetch
def fetch(self, limit: int | None = None) -> Iterator[RESOURCE]:with open(self.json_path) as f:json_data = json.load(f)pydantic_class = resource_create(cast(Hashable, self.resource_class))for json_item in json_data[:limit]:yield pydantic_class(**json_item)
2
6
2
64
0
32
37
32
self,limit
[]
Iterator[RESOURCE]
{"Assign": 2, "Expr": 1, "For": 1, "With": 1}
5
6
5
["open", "json.load", "resource_create", "cast", "pydantic_class"]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called ExampleConnector, that inherit another class.The function start at line 32 and ends at 37. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [32.0] and does not return any value. It declares 5.0 function...
aiondemand_AIOD-rest-api
HuggingFaceDatasetConnector
public
0
1
resource_class
def resource_class(self) -> type[Dataset]:return Dataset
1
2
1
12
0
32
33
32
self
[]
type[Dataset]
{"Return": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called HuggingFaceDatasetConnector, that inherit another class.The function start at line 32 and ends at 33. 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..
aiondemand_AIOD-rest-api
HuggingFaceDatasetConnector
public
0
1
platform_name
def platform_name(self) -> PlatformName:return PlatformName.huggingface
1
2
1
11
0
36
37
36
self
[]
PlatformName
{"Return": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called HuggingFaceDatasetConnector, that inherit another class.The function start at line 36 and ends at 37. 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..
aiondemand_AIOD-rest-api
HuggingFaceDatasetConnector
public
0
1
_get
def _get(url: str, dataset_id: str) -> typing.List[typing.Dict[str, typing.Any]]:response = requests.get(url, params={"dataset": dataset_id}, timeout=REQUEST_TIMEOUT)response_json = response.json()if not response.ok:msg = response_json["error"]logging.warning(f"Unable to retrieve parquet info for dataset '{dataset_id}'...
2
8
2
81
0
40
47
40
url,dataset_id
[]
typing.List[typing.Dict[str, typing.Any]]
{"Assign": 3, "Expr": 1, "If": 1, "Return": 2}
3
8
3
["requests.get", "response.json", "logging.warning"]
14
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3915747_balena_io_balena_sdk_python.balena.models.application_py.ApplicationConfigVariable.get", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3915747_balena_io_balena_sdk_python.balena.models.application_py.Applica...
The function (_get) defined within the public class called HuggingFaceDatasetConnector, that inherit another class.The function start at line 40 and ends at 47. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [40.0] and does not return any value. It declares 3....
aiondemand_AIOD-rest-api
HuggingFaceDatasetConnector
public
0
1
fetch
def fetch(self, limit: int | None = None) -> typing.Iterator[ResourceWithRelations[Dataset] | RecordError]:pydantic_class = resource_create(Dataset)pydantic_class_publication = resource_create(Publication)pydantic_class_contact = resource_create(Contact)for dataset in list_datasets(full=True, limit=limit):try:yield sel...
3
13
2
90
0
49
63
49
self,limit
[]
typing.Iterator[ResourceWithRelations[Dataset] | RecordError]
{"Assign": 3, "Expr": 2, "For": 1, "Try": 1}
6
15
6
["resource_create", "resource_create", "resource_create", "list_datasets", "self.fetch_dataset", "RecordError"]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called HuggingFaceDatasetConnector, that inherit another class.The function start at line 49 and ends at 63. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [49.0] and does not return any value. It declares ...
aiondemand_AIOD-rest-api
HuggingFaceDatasetConnector
public
0
1
fetch_dataset
def fetch_dataset(self,dataset: DatasetInfo,pydantic_class,pydantic_class_publication,pydantic_class_contact,):citations = self._parse_citations(dataset, pydantic_class_publication)parquet_info = HuggingFaceDatasetConnector._get(url="https://datasets-server.huggingface.co/parquet",dataset_id=dataset.id,)distributions =...
11
58
5
321
0
65
136
65
self,dataset,pydantic_class,pydantic_class_publication,pydantic_class_contact
[]
Returns
{"Assign": 12, "If": 5, "Return": 1}
13
72
13
["self._parse_citations", "HuggingFaceDatasetConnector._get", "Distribution", "math.ceil", "isinstance", "pydantic_class_contact", "getattr", "len", "len", "Text", "pydantic_class", "AIoDEntryCreate", "hasattr"]
0
[]
The function (fetch_dataset) defined within the public class called HuggingFaceDatasetConnector, that inherit another class.The function start at line 65 and ends at 136. It contains 58 lines of code and it has a cyclomatic complexity of 11. It takes 5 parameters, represented as [65.0], and this function return a value...
aiondemand_AIOD-rest-api
HuggingFaceDatasetConnector
public
0
1
_parse_citations
def _parse_citations(self, dataset, pydantic_class_publication) -> list:"""Best effort parsing of the citations. There are many"""raw_citation = getattr(dataset, "citation", None)if raw_citation is None:return []try:parsed_citations = bibtexparser.loads(raw_citation).entriesif len(parsed_citations) == 0 and raw_citatio...
10
24
3
166
0
138
168
138
self,dataset,pydantic_class_publication
[]
list
{"Assign": 3, "Expr": 1, "If": 3, "Return": 4, "Try": 1}
12
31
12
["getattr", "bibtexparser.loads", "len", "raw_citation.startswith", "bibtexparser.loads", "len", "len", "pydantic_class_publication", "AIoDEntryCreate", "pydantic_class_publication", "Text", "AIoDEntryCreate"]
0
[]
The function (_parse_citations) defined within the public class called HuggingFaceDatasetConnector, that inherit another class.The function start at line 138 and ends at 168. It contains 24 lines of code and it has a cyclomatic complexity of 10. It takes 3 parameters, represented as [138.0] and does not return any valu...
aiondemand_AIOD-rest-api
OpenMlDatasetConnector
public
0
1
resource_class
def resource_class(self) -> type[Dataset]:return Dataset
1
2
1
12
0
35
36
35
self
[]
type[Dataset]
{"Return": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called OpenMlDatasetConnector, that inherit another class.The function start at line 35 and ends at 36. 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..
aiondemand_AIOD-rest-api
OpenMlDatasetConnector
public
0
1
platform_name
def platform_name(self) -> PlatformName:return PlatformName.openml
1
2
1
11
0
39
40
39
self
[]
PlatformName
{"Return": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called OpenMlDatasetConnector, that inherit another class.The function start at line 39 and ends at 40. 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..
aiondemand_AIOD-rest-api
OpenMlDatasetConnector
public
0
1
retry
def retry(self, identifier: int) -> SQLModel | RecordError:url_qual = f"https://www.openml.org/api/v1/json/data/qualities/{identifier}"response = requests.get(url_qual, timeout=REQUEST_TIMEOUT)if not response.ok:msg = response.json()["error"]["message"]return RecordError(identifier=str(identifier),error=f"Error while f...
2
11
2
86
0
42
52
42
self,identifier
[]
SQLModel | RecordError
{"Assign": 4, "If": 1, "Return": 2}
6
11
6
["requests.get", "response.json", "RecordError", "str", "response.json", "self.fetch_record"]
51
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py._store_git_repos", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py.build_wheel", "_.content.gdriv...
The function (retry) defined within the public class called OpenMlDatasetConnector, that inherit another class.The function start at line 42 and ends at 52. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [42.0] and does not return any value. It declares 6.0 f...
aiondemand_AIOD-rest-api
OpenMlDatasetConnector
public
0
1
fetch_record
def fetch_record(self, identifier: int, qualities: list[dict[str, str]]) -> SQLModel | RecordError:url_data = f"https://www.openml.org/api/v1/json/data/{identifier}"response = requests.get(url_data, timeout=REQUEST_TIMEOUT)if not response.ok:msg = response.json()["error"]["message"]return RecordError(identifier=str(ide...
12
46
3
340
0
54
100
54
self,identifier,qualities
[]
SQLModel | RecordError
{"Assign": 13, "If": 6, "Return": 3}
20
47
20
["requests.get", "response.json", "RecordError", "str", "response.json", "resource_create", "isinstance", "len", "isinstance", "RecordError", "str", "len", "len", "Text", "DatasetSize", "_as_int", "pydantic_class", "AIoDEntryCreate", "dateutil.parser.parse", "Distribution"]
0
[]
The function (fetch_record) defined within the public class called OpenMlDatasetConnector, that inherit another class.The function start at line 54 and ends at 100. It contains 46 lines of code and it has a cyclomatic complexity of 12. It takes 3 parameters, represented as [54.0] and does not return any value. It decla...
aiondemand_AIOD-rest-api
OpenMlDatasetConnector
public
0
1
fetch
def fetch(self, offset: int, from_identifier: int) -> Iterator[SQLModel | RecordError]:url_data = ("https://www.openml.org/api/v1/json/data/list/"f"limit/{self.limit_per_iteration}/offset/{offset}")response = requests.get(url_data, timeout=REQUEST_TIMEOUT)if not response.ok:status_code = response.status_codemsg = respo...
8
30
3
199
0
102
133
102
self,offset,from_identifier
[]
Iterator[SQLModel | RecordError]
{"Assign": 10, "Expr": 6, "For": 1, "If": 3, "Return": 2, "Try": 2}
10
32
10
["requests.get", "response.json", "logging.error", "HTTPError", "RecordError", "response.json", "RecordError", "RecordError", "self.fetch_record", "RecordError"]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called OpenMlDatasetConnector, that inherit another class.The function start at line 102 and ends at 133. It contains 30 lines of code and it has a cyclomatic complexity of 8. It takes 3 parameters, represented as [102.0] and does not return any value. It declares 10...
aiondemand_AIOD-rest-api
public
public
0
0
_as_int
def _as_int(v: str) -> int:as_float = float(v)if not as_float.is_integer():raise ValueError(f"The input should be an integer, but was a float: {v}")return int(as_float)
2
5
1
34
1
136
140
136
v
['as_float']
int
{"Assign": 1, "If": 1, "Return": 1}
4
5
4
["float", "as_float.is_integer", "ValueError", "int"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.openml.openml_dataset_connector_py.OpenMlDatasetConnector.fetch_record"]
The function (_as_int) defined within the public class called public.The function start at line 136 and ends at 140. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions called inside...
aiondemand_AIOD-rest-api
OpenMlMLModelConnector
public
0
1
resource_class
def resource_class(self) -> type[MLModel]:return MLModel
1
2
1
12
0
37
38
37
self
[]
type[MLModel]
{"Return": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called OpenMlMLModelConnector, that inherit another class.The function start at line 37 and ends at 38. 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..
aiondemand_AIOD-rest-api
OpenMlMLModelConnector
public
0
1
platform_name
def platform_name(self) -> PlatformName:return PlatformName.openml
1
2
1
11
0
41
42
41
self
[]
PlatformName
{"Return": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called OpenMlMLModelConnector, that inherit another class.The function start at line 41 and ends at 42. 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..
aiondemand_AIOD-rest-api
OpenMlMLModelConnector
public
0
1
retry
def retry(self, identifier: int) -> ResourceWithRelations[SQLModel] | RecordError:return self.fetch_record(identifier)
1
2
2
23
0
44
45
44
self,identifier
[]
ResourceWithRelations[SQLModel] | RecordError
{"Return": 1}
1
2
1
["self.fetch_record"]
51
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py._store_git_repos", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py.build_wheel", "_.content.gdriv...
The function (retry) defined within the public class called OpenMlMLModelConnector, that inherit another class.The function start at line 44 and ends at 45. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [44.0] and does not return any value. It declare 1.0 fun...
aiondemand_AIOD-rest-api
OpenMlMLModelConnector
public
0
1
fetch_record
def fetch_record(self, identifier: int) -> ResourceWithRelations[MLModel] | RecordError:url_mlmodel = f"https://www.openml.org/api/v1/json/flow/{identifier}"response = requests.get(url_mlmodel, timeout=REQUEST_TIMEOUT)if not response.ok:msg = response.json()["error"]["message"]return RecordError(identifier=str(identifi...
6
42
2
285
0
47
94
47
self,identifier
[]
ResourceWithRelations[MLModel] | RecordError
{"Assign": 14, "If": 2, "Return": 3}
21
48
21
["requests.get", "response.json", "RecordError", "str", "response.json", "_description", "isinstance", "_distributions", "_as_list", "mlmodel_json.get", "_as_list", "mlmodel_json.get", "resource_create", "pydantic_class_contact", "_as_list", "mlmodel_json.get", "resource_create", "pydantic_class", "AIoDEntryCreate", "d...
0
[]
The function (fetch_record) defined within the public class called OpenMlMLModelConnector, that inherit another class.The function start at line 47 and ends at 94. It contains 42 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [47.0] and does not return any value. It declare...
aiondemand_AIOD-rest-api
OpenMlMLModelConnector
public
0
1
fetch
def fetch(self, offset: int, from_identifier: int) -> Iterator[ResourceWithRelations[SQLModel] | RecordError]:url_mlmodel = ("https://www.openml.org/api/v1/json/flow/list/"f"limit/{self.limit_per_iteration}/offset/{offset}")response = requests.get(url_mlmodel, timeout=REQUEST_TIMEOUT)if not response.ok:status_code = re...
9
34
3
216
0
96
135
96
self,offset,from_identifier
[]
Iterator[ResourceWithRelations[SQLModel] | RecordError]
{"Assign": 9, "Expr": 7, "For": 1, "If": 4, "Return": 2, "Try": 2}
11
40
11
["requests.get", "response.json", "logging.error", "HTTPError", "RecordError", "response.json", "RecordError", "RecordError", "self.fetch_record", "RecordError", "RecordError"]
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called OpenMlMLModelConnector, that inherit another class.The function start at line 96 and ends at 135. It contains 34 lines of code and it has a cyclomatic complexity of 9. It takes 3 parameters, represented as [96.0] and does not return any value. It declares 11.0...
aiondemand_AIOD-rest-api
public
public
0
0
_description
def _description(mlmodel_json: dict[str, Any], identifier: int) -> Text | None | RecordError:description = (mlmodel_json["full_description"]if mlmodel_json.get("full_description", None)else mlmodel_json.get("description", None))if isinstance(description, type(None)):return Noneif isinstance(description, list) and len(d...
8
18
2
142
2
138
155
138
mlmodel_json,identifier
['text_break', 'description']
Text | None | RecordError
{"Assign": 3, "If": 5, "Return": 5}
12
18
12
["mlmodel_json.get", "mlmodel_json.get", "isinstance", "type", "isinstance", "len", "isinstance", "RecordError", "str", "len", "len", "Text"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.openml.openml_mlmodel_connector_py.OpenMlMLModelConnector.fetch_record"]
The function (_description) defined within the public class called public.The function start at line 138 and ends at 155. It contains 18 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [138.0] and does not return any value. It declares 12.0 functions, It has 12.0 functions c...
aiondemand_AIOD-rest-api
public
public
0
0
_distributions
def _distributions(mlmodel_json) -> list[RunnableDistribution]:if ((mlmodel_json.get("installation_notes") is None)and (mlmodel_json.get("dependencies") is None)and (mlmodel_json.get("binary_url") is None)):return []return [RunnableDistribution(dependency=mlmodel_json.get("dependencies", None),installation=mlmodel_json...
4
14
1
88
0
158
171
158
mlmodel_json
[]
list[RunnableDistribution]
{"If": 1, "Return": 2}
7
14
7
["mlmodel_json.get", "mlmodel_json.get", "mlmodel_json.get", "RunnableDistribution", "mlmodel_json.get", "mlmodel_json.get", "mlmodel_json.get"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3960647_colcon_colcon_core.test.test_extension_point_py._entry_points", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3960647_colcon_colcon_core.test.test_extension_point_py.test_redefined_extension_point", "_.conte...
The function (_distributions) defined within the public class called public.The function start at line 158 and ends at 171. 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 7.0 functions, It has 7.0 functions calle...
aiondemand_AIOD-rest-api
public
public
0
0
_as_list
def _as_list(value: Any | list[Any]) -> list[Any]:"""Wrap it with a list, if it is not a list"""if not value:return []if not isinstance(value, list):return [value]return value
3
6
1
40
0
174
180
174
value
[]
list[Any]
{"Expr": 1, "If": 2, "Return": 3}
1
7
1
["isinstance"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.aibuilder.aibuilder_mlmodel_connector_py.AIBuilderMLModelConnector._mlmodel_from_solution", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_res...
The function (_as_list) defined within the public class called public.The function start at line 174 and ends at 180. 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 declare 1.0 function, It has 1.0 function called inside w...
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
resource_class
def resource_class(self) -> type[Dataset]:return Dataset
1
2
1
12
0
37
38
37
self
[]
type[Dataset]
{"Return": 1}
0
2
0
[]
0
[]
The function (resource_class) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 37 and ends at 38. 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..
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
platform_name
def platform_name(self) -> PlatformName:return PlatformName.zenodo
1
2
1
11
0
41
42
41
self
[]
PlatformName
{"Return": 1}
0
2
0
[]
0
[]
The function (platform_name) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 41 and ends at 42. 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..
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
retry
def retry(self, _id: int) -> ResourceWithRelations[Dataset] | RecordError:"""This function fetches only one record from Zenodo using the Rest API instead ofthe OAI-PMH one. When querying using the OAI protocol, we always receive all therecords, making it really inefficient to filter through all of them until we getthe ...
1
6
2
24
0
44
58
44
self,_id
[]
ResourceWithRelations[Dataset] | RecordError
{"Expr": 1}
1
15
1
["NotImplementedError"]
51
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py._store_git_repos", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508237_rcbops_ansible_lxc_rpc.scripts.rpc_wheel_builder_py.build_wheel", "_.content.gdriv...
The function (retry) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 44 and ends at 58. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [44.0] and does not return any value. It declare 1.0 fun...
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
_error_msg_bad_format
def _error_msg_bad_format(field) -> str:return f"Error while fetching record info: bad format {field}"
1
2
1
10
0
61
62
61
field
[]
str
{"Return": 1}
0
2
0
[]
0
[]
The function (_error_msg_bad_format) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 61 and ends at 62. 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..
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
_get_record
def _get_record(id_number: str) -> requests.Response:response = requests.get(f"https://zenodo.org/api/records/{id_number}/files", timeout=REQUEST_TIMEOUT)return response
1
5
1
26
0
68
72
68
id_number
[]
requests.Response
{"Assign": 1, "Return": 1}
3
5
3
["requests.get", "limits", "limits"]
0
[]
The function (_get_record) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 68 and ends at 72. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0...
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
_dataset_from_record
def _dataset_from_record(self, identifier: str, record: dict) -> ResourceWithRelations[Dataset] | RecordError:"""Process the information from a dataset and calls the Zenodo API for further information."""error_fmt = ZenodoDatasetConnector._error_msg_bad_formatcreators_raw = record.get("creators", {}).get("creator")crea...
45
127
3
980
0
74
218
74
self,identifier,record
[]
ResourceWithRelations[Dataset] | RecordError
{"AnnAssign": 1, "Assign": 46, "Expr": 3, "For": 1, "If": 24, "Return": 8, "Try": 1}
77
145
77
["get", "record.get", "isinstance", "get", "item.get", "isinstance", "isinstance", "isinstance", "get", "creators_raw.get", "RecordError", "error_fmt", "resource_create", "creators.append", "pydantic_class_contact", "get", "record.get", "isinstance", "RecordError", "error_fmt", "len", "len", "identifier.rsplit", "join"...
0
[]
The function (_dataset_from_record) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 74 and ends at 218. It contains 127 lines of code and it has a cyclomatic complexity of 45. It takes 3 parameters, represented as [74.0] and does not return any value....
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
_resource_type
def _resource_type(record) -> str | None:"""Cheap check before parsing the complete XML."""xml_string = record.rawstart = xml_string.find('<resourceType resourceTypeGeneral="')if start != -1:start += len('<resourceType resourceTypeGeneral="')end = xml_string.find('"', start)if end != -1:return xml_string[start:end]retu...
3
9
1
60
0
221
230
221
record
[]
str | None
{"Assign": 3, "AugAssign": 1, "Expr": 1, "If": 2, "Return": 2}
3
10
3
["xml_string.find", "len", "xml_string.find"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.zenodo.zenodo_dataset_connector_py.ZenodoDatasetConnector.fetch"]
The function (_resource_type) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 221 and ends at 230. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declare...
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
_check_harvesting_rate
def _check_harvesting_rate() -> None:pass
1
2
0
7
0
235
236
235
[]
None
{}
1
2
1
["limits"]
0
[]
The function (_check_harvesting_rate) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 235 and ends at 236. 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...
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
_fetch_record_list
def _fetch_record_list(self, records_iterator: BaseOAIIterator, batchsize: int) -> list:"""Fetches the maximum number of records available before the resumption token expires.It also ensures that the harvesting limit rate is not exceeded."""resumption_token = records_iterator.resumption_tokenif resumption_token and res...
11
35
3
204
0
238
278
238
self,records_iterator,batchsize
[]
list
{"Assign": 8, "AugAssign": 2, "Expr": 6, "For": 1, "If": 4, "Return": 1, "Try": 1}
12
41
12
["datetime.fromisoformat", "timedelta", "replace", "datetime.utcnow", "timedelta", "records_list.append", "replace", "datetime.utcnow", "logging.info", "self._check_harvesting_rate", "logging.info", "logging.info"]
0
[]
The function (_fetch_record_list) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 238 and ends at 278. It contains 35 lines of code and it has a cyclomatic complexity of 11. It takes 3 parameters, represented as [238.0] and does not return any value. ...
aiondemand_AIOD-rest-api
ZenodoDatasetConnector
public
0
1
fetch
def fetch(self, from_incl: datetime, to_excl: datetime) -> Iterator[Tuple[datetime | None, Dataset | ResourceWithRelations[Dataset] | RecordError]]:"""First it fetches all the records and then it process all of them.This way, it ensures to retrieve the maximum number of available records before theresumption token expi...
11
67
3
432
0
280
358
280
self,from_incl,to_excl
[]
Iterator[Tuple[datetime | None, Dataset | ResourceWithRelations[Dataset] | RecordError]]
{"AnnAssign": 2, "Assign": 23, "AugAssign": 1, "Expr": 6, "For": 1, "If": 4, "Return": 1, "Try": 2}
27
79
27
["self._check_harvesting_rate", "logging.info", "Sickle", "sickle.ListRecords", "isoformat", "from_incl.replace", "isoformat", "to_excl.replace", "RecordError", "xmltodict.parse", "get", "get", "oai_response_dict.get", "len", "int", "self._fetch_record_list", "logging.info", "len", "ZenodoDatasetConnector._resource_typ...
21
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.examples.reservations.common_py.Dispatcher.run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3637460_apache_qpid_python.qpid.tests.messaging.selector_py.SelectorTests.test_use_after_fork...
The function (fetch) defined within the public class called ZenodoDatasetConnector, that inherit another class.The function start at line 280 and ends at 358. It contains 67 lines of code and it has a cyclomatic complexity of 11. It takes 3 parameters, represented as [280.0] and does not return any value. It declares 2...
aiondemand_AIOD-rest-api
SchemaConverter
public
1
1
to_class
def to_class(self) -> Type[SCHEMA_CLASS]:pass
1
2
1
11
0
20
21
20
self
[]
Type[SCHEMA_CLASS]
{}
0
2
0
[]
0
[]
The function (to_class) defined within the public class called SchemaConverter, implement an interface, and it inherit another class.The function start at line 20 and ends at 21. 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....
aiondemand_AIOD-rest-api
SchemaConverter
public
1
1
convert
def convert(self, session: Session, aiod: RESOURCE) -> SCHEMA_CLASS:pass
1
2
3
16
0
24
25
24
self,session,aiod
[]
SCHEMA_CLASS
{}
0
2
0
[]
114
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3569468_lun_4_jose.ext.extra_py.Extra.presence", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3588611_cfelton_rhea.examples.cores.fifo36.test_fifo36_py.test_fifo36_conversion", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (convert) defined within the public class called SchemaConverter, implement an interface, and it inherit another class.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 3 parameters, represented as [24.0] and does not return any valu...
aiondemand_AIOD-rest-api
DatasetConverterDcatAP
public
0
1
to_class
def to_class(self) -> Type[DcatApWrapper]:return DcatApWrapper
1
2
1
12
0
26
27
26
self
[]
Type[DcatApWrapper]
{"Return": 1}
0
2
0
[]
0
[]
The function (to_class) defined within the public class called DatasetConverterDcatAP, that inherit another class.The function start at line 26 and ends at 27. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
DatasetConverterDcatAP
public
0
1
convert
def convert(self, session: Session, aiod: Dataset) -> DcatApWrapper:release_date = (XSDDateTime(value_=aiod.date_published) if aiod.date_published is not None else None)update_date = XSDDateTime(value_=aiod.aiod_entry.date_modified)if aiod.description and aiod.description.plain:description = aiod.description.plainelif ...
16
57
3
436
0
29
88
29
self,session,aiod
[]
DcatApWrapper
{"AnnAssign": 2, "Assign": 12, "Expr": 5, "For": 3, "If": 4, "Return": 1}
21
60
21
["XSDDateTime", "XSDDateTime", "DcatAPDataset", "VCardIndividual", "_replace_special_chars", "format", "graph.append", "DcatAPIdentifier", "VCardIndividual", "_replace_special_chars", "format", "graph.append", "DcatAPIdentifier", "SpdxChecksum", "graph.append", "DcatAPDistribution", "DcatAPIdentifier", "dataset.distrib...
114
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3569468_lun_4_jose.ext.extra_py.Extra.presence", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3588611_cfelton_rhea.examples.cores.fifo36.test_fifo36_py.test_fifo36_conversion", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (convert) defined within the public class called DatasetConverterDcatAP, that inherit another class.The function start at line 29 and ends at 88. It contains 57 lines of code and it has a cyclomatic complexity of 16. It takes 3 parameters, represented as [29.0] and does not return any value. It declares 21...
aiondemand_AIOD-rest-api
public
public
0
0
_replace_special_chars
def _replace_special_chars(name: str) -> str:"""Replace special characters with underscores.Args:name: a name of a json-ld object.Returns:a sanitized version of the name"""return re.sub("[^A-Za-z0-9]", "_", name)
1
2
1
21
0
91
100
91
name
[]
str
{"Expr": 1, "Return": 1}
1
10
1
["re.sub"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.converters.schema_converters.dataset.dataset_dcatap_converter_py.DatasetConverterDcatAP.convert"]
The function (_replace_special_chars) defined within the public class called public.The function start at line 91 and ends at 100. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function ca...
aiondemand_AIOD-rest-api
DatasetConverterSchemaDotOrg
public
0
1
to_class
def to_class(self) -> Type[SchemaDotOrgDataset]:return SchemaDotOrgDataset
1
2
1
12
0
25
26
25
self
[]
Type[SchemaDotOrgDataset]
{"Return": 1}
0
2
0
[]
0
[]
The function (to_class) defined within the public class called DatasetConverterSchemaDotOrg, that inherit another class.The function start at line 25 and ends at 26. 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..
aiondemand_AIOD-rest-api
DatasetConverterSchemaDotOrg
public
0
1
convert
def convert(self, session: Session, aiod: Dataset) -> SchemaDotOrgDataset:creator = [SchemaDotOrgPerson(name=creator.contact_name)for creator in aiod.creatorif creator.contact_name]funder = [_agent(session, agent_table) for agent_table in aiod.funder]funder = [f for f in funder if f]citations = [_publication(publicatio...
16
50
3
325
0
28
77
28
self,session,aiod
[]
SchemaDotOrgDataset
{"Assign": 7, "If": 2, "Return": 1}
11
50
11
["SchemaDotOrgPerson", "_agent", "_publication", "SchemaDotOrgDataset", "_list_to_one_or_none", "_list_to_one_or_none", "_list_to_one_or_none", "_list_to_one_or_none", "_list_to_one_or_none", "_list_to_one_or_none", "SchemaDotOrgDataDownload"]
114
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3569468_lun_4_jose.ext.extra_py.Extra.presence", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3588611_cfelton_rhea.examples.cores.fifo36.test_fifo36_py.test_fifo36_conversion", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (convert) defined within the public class called DatasetConverterSchemaDotOrg, that inherit another class.The function start at line 28 and ends at 77. It contains 50 lines of code and it has a cyclomatic complexity of 16. It takes 3 parameters, represented as [28.0] and does not return any value. It decla...
aiondemand_AIOD-rest-api
public
public
0
0
_list_to_one_or_none
def _list_to_one_or_none(value: set[V] | list[V]) -> set[V] | list[V] | V | None:"""All schema.org fields can be repeated. This function can be used to return None if theinput is empty, return the only value if there is only one value, or otherwise return theinput set/list."""if len(value) == 0:return Noneif len(value)...
3
7
1
58
0
83
93
83
value
[]
set[V] | list[V] | V | None
{"Assign": 1, "Expr": 1, "If": 2, "Return": 3}
2
11
2
["len", "len"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.converters.schema_converters.dataset.dataset_schemadotorg_converter_py.DatasetConverterSchemaDotOrg.convert"]
The function (_list_to_one_or_none) defined within the public class called public.The function start at line 83 and ends at 93. It contains 7 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions ca...
aiondemand_AIOD-rest-api
public
public
0
0
_publication
def _publication(publication: Publication) -> str:names = (creator.contact_name for creator in publication.creator if creator.contact_name)return f"{publication.name} by {', '.join(names)}"
3
3
1
29
1
96
98
96
publication
['names']
str
{"Assign": 1, "Return": 1}
1
3
1
["join"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.converters.schema_converters.dataset.dataset_schemadotorg_converter_py.DatasetConverterSchemaDotOrg.convert"]
The function (_publication) defined within the public class called public.The function start at line 96 and ends at 98. It contains 3 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 declare 1.0 function, It has 1.0 function called inside...
aiondemand_AIOD-rest-api
public
public
0
0
_agent
def _agent(session: Session, agent: AgentTable) -> SchemaDotOrgPerson | SchemaDotOrgOrganization | None:if agent.type == Person.__tablename__:query = select(Person).where(Person.agent_id == agent.identifier)person: Person = session.scalars(query).first()if person:name = ", ".join([name for name in (person.surname, pers...
10
20
2
178
2
101
120
101
session,agent
['name', 'query']
SchemaDotOrgPerson | SchemaDotOrgOrganization | None
{"AnnAssign": 2, "Assign": 5, "If": 5, "Return": 3}
12
20
12
["where", "select", "first", "session.scalars", "join", "SchemaDotOrgPerson", "where", "select", "first", "session.scalars", "SchemaDotOrgOrganization", "ValueError"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.converters.schema_converters.dataset.dataset_schemadotorg_converter_py.DatasetConverterSchemaDotOrg.convert"]
The function (_agent) defined within the public class called public.The function start at line 101 and ends at 120. It contains 20 lines of code and it has a cyclomatic complexity of 10. It takes 2 parameters, represented as [101.0] and does not return any value. It declares 12.0 functions, It has 12.0 functions called...
aiondemand_AIOD-rest-api
PermissionType
public
0
1
__lt__
def __lt__(self, other: "PermissionType") -> bool:if not isinstance(other, PermissionType):return NotImplemented# _sort_order_ is definition order: https://github.com/python/cpython/blob/main/Lib/enum.pyreturn self._sort_order_ < other._sort_order_# type: ignore[attr-defined]
2
4
2
30
0
27
31
27
self,other
[]
bool
{"If": 1, "Return": 2}
1
5
1
["isinstance"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69766503_google_fiddle.fiddle._src.daglish_py.Attr.__lt__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69766503_google_fiddle.fiddle._src.daglish_py.Index.__lt__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Cre...
The function (__lt__) defined within the public class called PermissionType, that inherit another class.The function start at line 27 and ends at 31. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [27.0] and does not return any value. It declare 1.0 function, ...
aiondemand_AIOD-rest-api
public
public
0
0
_user_has_permission
def _user_has_permission(user: KeycloakUser, aiod_entry: AIoDEntryORM, *, at_least: PermissionType) -> bool:return any(permission.user_identifier == user._subject_identifier and permission.type_ >= at_leastfor permission in aiod_entry.permissions)
3
7
3
42
0
55
61
55
user,aiod_entry,at_least
[]
bool
{"Return": 1}
1
7
1
["any"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.authorization_py.user_can_read"]
The function (_user_has_permission) defined within the public class called public.The function start at line 55 and ends at 61. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [55.0] and does not return any value. It declare 1.0 function, It has 1.0 function ca...
aiondemand_AIOD-rest-api
public
public
0
0
user_can_read
def user_can_read(user: KeycloakUser, aiod_entry) -> bool:if aiod_entry.status == EntryStatus.PUBLISHED:return Truereturn _user_has_permission(user, aiod_entry, at_least=PermissionType.READ)
2
4
2
35
0
64
67
64
user,aiod_entry
[]
bool
{"If": 1, "Return": 2}
1
4
1
["_user_has_permission"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.asset_router_py.create", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.resource_router_py.ResourceRouter.get_resource", "_....
The function (user_can_read) defined within the public class called public.The function start at line 64 and ends at 67. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [64.0] and does not return any value. It declare 1.0 function, It has 1.0 function called in...
aiondemand_AIOD-rest-api
public
public
0
0
register_user
def register_user(kc_user: KeycloakUser, session: Session) -> User:query = select(User).where(User.subject_identifier == kc_user._subject_identifier)user = session.scalars(query).first()if user is None:user = User(subject_identifier=kc_user._subject_identifier)session.add(user)return user
2
7
2
65
2
74
80
74
kc_user,session
['user', 'query']
User
{"Assign": 3, "Expr": 1, "If": 1, "Return": 1}
6
7
6
["where", "select", "first", "session.scalars", "User", "session.add"]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.bookmark_router_py.create", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.resource_router_py.ResourceRouter.register_resour...
The function (register_user) defined within the public class called public.The function start at line 74 and ends at 80. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [74.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions called...
aiondemand_AIOD-rest-api
public
public
0
0
set_permission
def set_permission(user: KeycloakUser, resource: AIoDEntryORM, session: Session, *, type_: PermissionType):key = {"user_identifier": user._subject_identifier,"aiod_entry_identifier": resource.identifier,}permission = session.get(Permission, key)if permission is None:permission = Permission(user_identifier=user._subject...
2
12
4
77
2
83
94
83
user,resource,session,type_
['permission', 'key']
None
{"Assign": 4, "Expr": 1, "If": 1}
3
12
3
["session.get", "Permission", "session.add"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.resource_router_py.ResourceRouter.register_resource_func", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.authorization.test_a...
The function (set_permission) defined within the public class called public.The function start at line 83 and ends at 94. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [83.0] and does not return any value. It declares 3.0 functions, It has 3.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
create_id_generator.generate_identifier
def generate_identifier() -> str:random_string = "".join(random.choices(alpha_numeric, k=n))# noqa: S311# non-crypto applicationreturn f"{prefix}{seperator}{random_string}"
1
3
0
26
0
16
18
16
null
[]
None
null
0
0
0
null
0
null
The function (create_id_generator.generate_identifier) defined within the public class called public.The function start at line 16 and ends at 18. 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..
aiondemand_AIOD-rest-api
public
public
0
0
create_id_generator
def create_id_generator(prefix: str = "temp", seperator: str = "_", n: int = 24) -> Callable[[], str]:if len(prefix) > 4:raise ValueError(f"Provided prefix {prefix!r} must contain at most 4 characters.")if len(seperator) > 1:raise ValueError(f"Provided seperator {seperator!r} must contain at most 1 characters.")alpha_n...
3
10
3
70
2
6
20
6
prefix,seperator,n
['random_string', 'alpha_numeric']
Callable[[], str]
{"Assign": 2, "If": 2, "Return": 2}
6
15
6
["len", "ValueError", "len", "ValueError", "join", "random.choices"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.concept.concept_py.AIoDConcept.set_dynamic_default_identifier"]
The function (create_id_generator) defined within the public class called public.The function start at line 6 and ends at 20. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [6.0] and does not return any value. It declares 6.0 functions, It has 6.0 functions c...
aiondemand_AIOD-rest-api
Submission
public
0
1
assets
def assets(self) -> list[AIoDConcept]:# I could not find a way to just use a Relationship directly on account of it needing# to be defined on creation but the asset_type is only known at runtime.# We still mimic the behavior of a lazy-loaded relationship by fetching the session# related to the object, instead of instan...
4
11
1
105
0
122
137
122
self
[]
list[AIoDConcept]
{"AnnAssign": 1, "Assign": 6, "Expr": 1, "For": 1, "Return": 1}
7
16
7
["Session.object_session", "list", "non_abstract_subclasses", "identifier.split", "get_asset_type_by_abbreviation", "assets.append", "session.get"]
0
[]
The function (assets) defined within the public class called Submission, that inherit another class.The function start at line 122 and ends at 137. It contains 11 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 7.0 functions, an...
aiondemand_AIOD-rest-api
Submission
public
0
1
is_pending
def is_pending(self):return len(self.reviews) < REQUIRED_NUMBER_OF_REVIEWS
1
2
1
14
0
140
141
140
self
[]
Returns
{"Return": 1}
1
2
1
["len"]
0
[]
The function (is_pending) defined within the public class called Submission, that inherit another class.The function start at line 140 and ends at 141. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 functio...