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
public
public
0
0
schema_extra
def schema_extra(schema: dict[str, Any], _: type["SubmissionView"]) -> None:schema["properties"]["assets"] = {"type": "array","title": "Assets under review","items": {"title": "Asset","description": "The type of the object can be derived from its identifier.","type": "object","anyOf": get_all_asset_schemas(),},}
1
11
2
62
0
156
166
156
null
[]
None
null
0
0
0
null
0
null
The function (schema_extra) defined within the public class called public.The function start at line 156 and ends at 166. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [156.0] and does not return any value..
aiondemand_AIOD-rest-api
EngineSingleton
public
0
0
__init__
def __init__(self):if not EngineSingleton.__monostate:EngineSingleton.__monostate = self.__dict__self.engine = create_engine(db_url(), echo=False, pool_recycle=3600)else:self.__dict__ = EngineSingleton.__monostate
2
6
1
45
0
18
23
18
self
[]
None
{"Assign": 3, "If": 1}
2
6
2
["create_engine", "db_url"]
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 EngineSingleton.The function start at line 18 and ends at 23. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions calle...
aiondemand_AIOD-rest-api
EngineSingleton
public
0
0
patch
def patch(self, engine: Engine):self.__monostate["engine"] = engine# type: ignore
1
2
2
17
0
25
26
25
self,engine
[]
None
{"Assign": 1}
0
2
0
[]
3,224
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.tests.test_id_generators_py.KoremutakeGeneratorTest.test_it_doesnt_reuse_a_name_twice", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3536852_ubuntu_solutions_engineering_opensta...
The function (patch) defined within the public class called EngineSingleton.The function start at line 25 and ends at 26. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [25.0] and does not return any value. It has 3224.0 functions calling this function which a...
aiondemand_AIOD-rest-api
public
public
0
0
db_url
def db_url(including_db=True):username = DB_CONFIG.get("name", "root")password = DB_CONFIG.get("password", "ok")host = DB_CONFIG.get("host", "demodb")port = DB_CONFIG.get("port", 3306)database = DB_CONFIG.get("database", "aiod")if including_db:return f"mysql://{username}:{password}@{host}:{port}/{database}"return f"mys...
2
9
1
66
5
29
37
29
including_db
['port', 'host', 'password', 'username', 'database']
Returns
{"Assign": 5, "If": 1, "Return": 2}
5
9
5
["DB_CONFIG.get", "DB_CONFIG.get", "DB_CONFIG.get", "DB_CONFIG.get", "DB_CONFIG.get"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.alembic.alembic.env_py.run_migrations_offline", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.session_py.EngineSingleton.__init__", "_...
The function (db_url) defined within the public class called public.The function start at line 29 and ends at 37. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 functions called insid...
aiondemand_AIOD-rest-api
public
public
0
0
DbSession
def DbSession(autoflush: bool = True) -> Session:"""Returning a SQLModel session bound to the (configured) database engine.For usage with FastAPI, use `get_session`."""session = Session(EngineSingleton().engine, autoflush=autoflush)try:yield sessionfinally:session.close()
2
6
1
37
1
41
50
41
autoflush
['session']
Session
{"Assign": 1, "Expr": 3, "Try": 1}
3
10
3
["Session", "EngineSingleton", "session.close"]
86
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.alembic.alembic.versions.42f747800456_knowledge_asset_identifiers_py.upgrade", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.alembic.alembic.versio...
The function (DbSession) defined within the public class called public.The function start at line 41 and ends at 50. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called inside...
aiondemand_AIOD-rest-api
public
public
0
0
get_session
def get_session():with DbSession() as session:yield session
1
3
0
13
0
53
55
53
[]
None
{"Expr": 1, "With": 1}
1
3
1
["DbSession"]
84
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3925410_remyroy_cdda_game_launcher.cddagl.sql.functions_py.get_build_from_sha256", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3925410_remyroy_cdda_game_launcher.cddagl.sql.functions_py.get_config_value", "_.conte...
The function (get_session) defined within the public class called public.The function start at line 53 and ends at 55. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called inside ...
aiondemand_AIOD-rest-api
public
public
0
0
create_database
def create_database(*, delete_first: bool):url = db_url(including_db=False)engine = create_engine(url, echo=False)# Temporary engine, not connected to a databasewith engine.connect() as connection:database = DB_CONFIG.get("database", "aiod")if delete_first:connection.execute(text(f"DROP DATABASE IF EXISTS {database}"))...
2
8
1
69
3
18
25
18
delete_first
['url', 'database', 'engine']
None
{"Assign": 3, "Expr": 2, "If": 1, "With": 1}
8
8
8
["db_url", "create_engine", "engine.connect", "DB_CONFIG.get", "connection.execute", "text", "connection.execute", "text"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3712295_dalibo_temboard_agent.tests.func.test_activity_py.TestActivity.test_03_activity_waiting", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3712295_dalibo_temboard_agent.tests.func.test_activity_py.TestActivity....
The function (create_database) defined within the public class called public.The function start at line 18 and ends at 25. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 8.0 functions, It has 8.0 functions called ...
aiondemand_AIOD-rest-api
public
public
0
0
database_exists
def database_exists() -> bool:"""Checks whether the database defined in the configuration exists."""url = db_url(including_db=True)# Using the singleton defined in `Session.py` may be cleaner, but I could# not find documentation that ensures me that creating the engine there and# then potentially re-creating the databa...
2
9
0
44
2
28
42
28
['url', 'engine']
bool
{"Assign": 2, "Expr": 1, "Return": 2, "Try": 1, "With": 1}
3
15
3
["db_url", "create_engine", "engine.connect"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.main_py.create_app"]
The function (database_exists) defined within the public class called public.The function start at line 28 and ends at 42. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called ...
aiondemand_AIOD-rest-api
public
public
0
0
_get_existing_resource
def _get_existing_resource(session: sqlmodel.Session, resource: AIoDConcept, clazz: type[SQLModel]) -> AIoDConcept | None:"""Selecting a resource based on platform and platform_resource_identifier"""is_enum = NamedRelation in clazz.__mro__if is_enum:query = select(clazz).where(clazz.name == resource)else:query = select...
2
14
3
92
2
45
59
45
session,resource,clazz
['query', 'is_enum']
AIoDConcept | None
{"Assign": 3, "Expr": 1, "If": 1, "Return": 1}
7
15
7
["where", "select", "where", "select", "and_", "first", "session.scalars"]
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 (_get_existing_resource) defined within the public class called public.The function start at line 45 and ends at 59. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [45.0] and does not return any value. It declares 7.0 functions, It has 7.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
hard_delete_older_than
def hard_delete_older_than(time_threshold: timedelta):classes: list[Type[AIoDConcept]] = non_abstract_subclasses(AIoDConcept)date_threshold = datetime.datetime.now() - time_thresholdwith DbSession() as session:for concept in classes:filter_ = and_(is_not(concept.date_deleted, None),concept.date_deleted < date_threshold...
2
12
1
86
3
23
34
23
time_threshold
['statement', 'date_threshold', 'filter_']
None
{"AnnAssign": 1, "Assign": 3, "Expr": 2, "For": 1, "With": 1}
9
12
9
["non_abstract_subclasses", "datetime.datetime.now", "DbSession", "and_", "is_not", "where", "delete", "session.exec", "session.commit"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.deletion.hard_delete_py.main"]
The function (hard_delete_older_than) defined within the public class called public.The function start at line 23 and ends at 34. It contains 12 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 9.0 functions, It has 9.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
_parse_args
def _parse_args() -> argparse.Namespace:parser = argparse.ArgumentParser(description="Hard delete all soft-deleted items of a certain age.")parser.add_argument("--time-threshold-minutes",required=True,type=int,help="Delete all items that have been soft-deleted at least this long ago.",)return parser.parse_args()
1
11
0
43
1
37
47
37
['parser']
argparse.Namespace
{"Assign": 1, "Expr": 1, "Return": 1}
3
11
3
["argparse.ArgumentParser", "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 37 and ends at 47. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called ins...
aiondemand_AIOD-rest-api
public
public
0
0
main
def main():args = _parse_args()time_threshold = timedelta(minutes=args.time_threshold_minutes)hard_delete_older_than(time_threshold=time_threshold)
1
4
0
25
2
50
53
50
['args', 'time_threshold']
None
{"Assign": 2, "Expr": 1}
3
4
3
["_parse_args", "timedelta", "hard_delete_older_than"]
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 50 and ends at 53. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called inside whic...
aiondemand_AIOD-rest-api
public
public
0
0
create_identifier_synchronization_triggers
def create_identifier_synchronization_triggers(dialect: str = "mysql"):# Sync triggers make sure all identifiers of an asset are identical.# See also: docs/developer/schema/index.md#a_note_on_identifiers# These objects are imported here to avoid circular imports,# these classes indirectly import triggers through their ...
4
27
1
182
6
16
65
16
dialect
['triggers', 'sqlite_ddl', 'parent_table_name', 'reference_column', 'msg', 'mysql_ddl']
Returns
{"Assign": 6, "Expr": 1, "For": 2, "Return": 1}
4
50
4
["non_abstract_subclasses", "DDL", "DDL", "triggers.append"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.main_py.build_database", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.testutils.default_sqlalchemy_py.engine"]
The function (create_identifier_synchronization_triggers) defined within the public class called public.The function start at line 16 and ends at 65. It contains 27 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 4.0 functio...
aiondemand_AIOD-rest-api
public
public
0
0
create_delete_triggers
def create_delete_triggers(parent_class: Type[SQLModel]):classes: list[Type[SQLModel]] = non_abstract_subclasses(parent_class)triggers = []for cls in classes:for name, value in get_relationships(cls).items():trigger = value.create_triggers(cls, name)if trigger is not None:triggers.append(trigger)return triggers
4
9
1
71
2
68
76
68
parent_class
['triggers', 'trigger']
Returns
{"AnnAssign": 1, "Assign": 2, "Expr": 1, "For": 2, "If": 1, "Return": 1}
5
9
5
["non_abstract_subclasses", "items", "get_relationships", "value.create_triggers", "triggers.append"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.main_py.build_database", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.testutils.default_sqlalchemy_py.engine"]
The function (create_delete_triggers) defined within the public class called public.The function start at line 68 and ends at 76. It contains 9 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 5.0 functions, It has 5.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
create_deletion_trigger_one_to_one
def create_deletion_trigger_one_to_one(trigger: Type[SQLModel],to_delete: Type[SQLModel],trigger_identifier_link: str = "identifier",to_delete_identifier: str = "identifier",):"""Create a trigger for a one-to-one relationship, so that if a row from trigger is deleted, anyrow in the to_delete is also deleted where trigg...
1
10
4
47
2
79
118
79
trigger,to_delete,trigger_identifier_link,to_delete_identifier
['delete_name', 'trigger_name']
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
1
40
1
["DDL"]
0
[]
The function (create_deletion_trigger_one_to_one) defined within the public class called public.The function start at line 79 and ends at 118. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [79.0], and this function return a value. It declare 1.0 function, an...
aiondemand_AIOD-rest-api
public
public
0
0
create_deletion_trigger_many_to_one
def create_deletion_trigger_many_to_one(trigger: Type[SQLModel],to_delete: Type[SQLModel],trigger_identifier_link: str,to_delete_identifier: str = "identifier",):"""Create a trigger for a many-to-one relationship, so that if a row from trigger is deleted,any **orphan** row in the to_delete is also deleted where trigger...
1
10
4
45
2
121
156
121
trigger,to_delete,trigger_identifier_link,to_delete_identifier
['delete_name', 'trigger_name']
Returns
{"Assign": 2, "Expr": 1, "Return": 1}
1
36
1
["DDL"]
0
[]
The function (create_deletion_trigger_many_to_one) defined within the public class called public.The function start at line 121 and ends at 156. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [121.0], and this function return a value. It declare 1.0 function,...
aiondemand_AIOD-rest-api
public
public
0
0
create_deletion_trigger_many_to_many
def create_deletion_trigger_many_to_many(trigger: Type[SQLModel],link: Type[SQLModel],to_delete: Type[SQLModel],trigger_identifier: str = "identifier",link_from_identifier: str = "from_identifier",link_to_identifier: str = "linked_identifier",to_delete_identifier: str = "identifier",other_links: None | list[str] = None...
3
19
8
113
5
159
211
159
trigger,link,to_delete,trigger_identifier,link_from_identifier,link_to_identifier,to_delete_identifier,other_links
['links_clause', 'link_names', 'delete_name', 'link_name', 'trigger_name']
Returns
{"Assign": 5, "Expr": 1, "Return": 1}
3
53
3
["set", "join", "DDL"]
0
[]
The function (create_deletion_trigger_many_to_many) defined within the public class called public.The function start at line 159 and ends at 211. It contains 19 lines of code and it has a cyclomatic complexity of 3. It takes 8 parameters, represented as [159.0], and this function return a value. It declares 3.0 functio...
aiondemand_AIOD-rest-api
public
public
0
0
all_annotations
def all_annotations(cls) -> ChainMap:"""Returns a dictionary-like ChainMap that includes annotations for allattributes defined in cls or inherited from superclasses.Fromhttps://stackoverflow.com/questions/63903901/how-can-i-access-to-annotations-of-parent-class"""return ChainMap(*(inspect.get_annotations(c) for c in cl...
2
2
1
29
0
15
22
15
cls
[]
ChainMap
{"Expr": 1, "Return": 1}
3
8
3
["ChainMap", "inspect.get_annotations", "cls.mro"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.resource_read_and_create_py._get_field_definitions_create", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.res...
The function (all_annotations) defined within the public class called public.The function start at line 15 and ends at 22. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called ...
aiondemand_AIOD-rest-api
public
public
0
0
datatype_of_field
def datatype_of_field(clazz: Type[SQLModel], field_name: str) -> Type | str:"""Returns the datatype of a field, based on the annotations. It returns the inner type in caseof a list, or an optional. Returns a str in case a forward reference was used.Examples:- name: str returns str- issn: str | Nonereturns str- funder: ...
8
27
2
152
2
25
63
25
clazz,field_name
['annotation', 'extracted']
Type | str
{"Assign": 7, "Expr": 1, "If": 5, "Return": 1}
10
39
10
["inspect.get_annotations", "_is_mapped_annotation", "_extract_mapped_subtype", "type", "typing_inspect.is_optional_type", "typing_inspect.get_args", "typing_inspect.is_optional_type", "typing_inspect.is_generic_type", "typing_inspect.get_args", "isinstance"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.connectors.resource_with_relations_py.ResourceWithRelations.__post_init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.re...
The function (datatype_of_field) defined within the public class called public.The function start at line 25 and ends at 63. It contains 27 lines of code and it has a cyclomatic complexity of 8. It takes 2 parameters, represented as [25.0] and does not return any value. It declares 10.0 functions, It has 10.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
get_versioned_resource
def get_versioned_resource(resource: type[AIoDConcept],version: Version = Version.LATEST,mapping: dict[Version, VersionedResource] | None = None,) -> VersionedResource:versioned_resources = mapping or globals().get(f"{resource.__tablename__}_versions")if not versioned_resources:raise ValueError(f"No versioned resources...
4
14
3
76
1
22
35
22
resource,version,mapping
['versioned_resources']
VersionedResource
{"Assign": 1, "If": 2, "Return": 1}
6
14
6
["get", "globals", "ValueError", "KeyError", "set", "versioned_resources.keys"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.search_router_py.SearchRouter.create"]
The function (get_versioned_resource) defined within the public class called public.The function start at line 22 and ends at 35. It contains 14 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [22.0] and does not return any value. It declares 6.0 functions, It has 6.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
many_to_many_link_factory
def many_to_many_link_factory(table_from: str,table_to: str,table_prefix=None,table_from_identifier="identifier",table_to_identifier="identifier",from_identifier_type=int,to_identifier_type=int,):"""Create a table linking table_name_from to table_name_to, using the .identifier at bothsides."""prefix = "" if table_prefi...
4
47
7
168
5
13
63
13
table_from,table_to,table_prefix,table_from_identifier,table_to_identifier,from_identifier_type,to_identifier_type
['prefix', 'str_type', 'LinkTable', 'int_type', 'name']
Returns
{"Assign": 6, "Expr": 1, "Return": 1}
9
51
9
["String", "create_model", "dict", "Field", "Column", "ForeignKey", "Field", "Column", "ForeignKey"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.ai_asset.ai_asset_py.AIAsset.update_relationships_asset", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.ai_re...
The function (many_to_many_link_factory) defined within the public class called public.The function start at line 13 and ends at 63. It contains 47 lines of code and it has a cyclomatic complexity of 4. It takes 7 parameters, represented as [13.0], and this function return a value. It declares 9.0 functions, It has 9.0...
aiondemand_AIOD-rest-api
public
public
0
0
get_relationships
def get_relationships(resource_class: Type[SQLModel]) -> dict[str, "_ResourceRelationship"]:if not hasattr(resource_class, "RelationshipConfig"):return {}config = resource_class.RelationshipConfigreturn {field: getattr(config, field) for field in dir(config) if not field.startswith("_")}
4
5
1
60
1
66
70
66
resource_class
['config']
dict[str, '_ResourceRelationship']
{"Assign": 1, "If": 1, "Return": 2}
4
5
4
["hasattr", "getattr", "dir", "field.startswith"]
5
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.deletion.triggers_py.create_delete_triggers", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.resource_read_and_creat...
The function (get_relationships) defined within the public class called public.The function start at line 66 and ends at 70. It contains 5 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 4.0 functions, It has 4.0 functions calle...
aiondemand_AIOD-rest-api
public
public
0
0
non_abstract_subclasses
def non_abstract_subclasses(cls):"""All non-abstract subclasses of the class.To check if a class is abstract, we check if it has any children itself. This will break ifwe ever inherit from a non-abstract class."""for child in cls.__subclasses__():has_grandchild = Falsefor grand_child in non_abstract_subclasses(child):h...
4
8
1
37
1
73
86
73
cls
['has_grandchild']
None
{"Assign": 2, "Expr": 3, "For": 2, "If": 1}
2
14
2
["cls.__subclasses__", "non_abstract_subclasses"]
9
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.deletion.hard_delete_py.hard_delete_older_than", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.deletion.triggers_py.creat...
The function (non_abstract_subclasses) defined within the public class called public.The function start at line 73 and ends at 86. It contains 8 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions...
aiondemand_AIOD-rest-api
NamedRelation
public
0
1
__table_args__
def __table_args__(cls) -> Tuple:return (CheckConstraint(CONSTRAINT_LOWERCASE_NAME,name=f"{cls.__name__}_name_lowercase",),)
1
7
1
21
0
30
36
30
cls
[]
Tuple
{"Return": 1}
1
7
1
["CheckConstraint"]
0
[]
The function (__table_args__) defined within the public class called NamedRelation, that inherit another class.The function start at line 30 and ends at 36. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 functi...
aiondemand_AIOD-rest-api
NamedRelation
public
0
1
__table_args__
def __table_args__(cls) -> Tuple:# `NamedRelation` would enforce lower-case to help normalize,# which we do not want for predefined terms as we assume capitalization to be correct.return tuple()
1
2
1
11
0
54
57
54
cls
[]
Tuple
{"Return": 1}
1
7
1
["CheckConstraint"]
0
[]
The function (__table_args__) defined within the public class called NamedRelation, that inherit another class.The function start at line 54 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. It declare 1.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
create_taxonomy
def create_taxonomy(class_name: str,table_name: str,plural_name: str,) -> type[Taxonomy]:clazz = create_model(__model_name=class_name,__base__=Taxonomy,__cls_kwargs__=dict(table=True),__tablename__=(str, table_name),__plural__=(str, plural_name),# Taxonomies are hierarchical, e.g., a Cow is also a Mammal.# These fields...
1
30
3
137
1
60
92
60
class_name,table_name,plural_name
['clazz']
type[Taxonomy]
{"Assign": 1, "Return": 1}
8
33
8
["create_model", "dict", "Field", "ForwardRef", "Relationship", "dict", "ForwardRef", "Relationship"]
0
[]
The function (create_taxonomy) defined within the public class called public.The function start at line 60 and ends at 92. It contains 30 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [60.0] and does not return any value. It declares 8.0 functions, and It has 8.0 function...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
field
def field(self):return Field(description=self.description,# Wrapping the example in a list means that the actual value is used (default None),# this allows `null` to be shown in place of `"string"` or `0` when no example is# provided for resp. a string or an integer.schema_extra={"examples": [self.example]},# schema_ex...
1
6
1
33
0
56
65
56
self
[]
Returns
{"Return": 1}
1
10
1
["Field"]
35
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3584344_influxgraph_influxgraph.tests.test_influxdb_templates_integration_py.InfluxGraphTemplatesIntegrationTestCase.test_template_filter_patterns", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964638_python_restx...
The function (field) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 56 and ends at 65. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function retur...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
serializer
def serializer(self) -> serializers.Serializer | None:if self.deserialized_path is None:return self._serializerif self._serializer is None:raise ValueError("_serializer should be defined if using a deserialized_path")return GetPathSerializer(self.deserialized_path, self._serializer)
3
6
1
45
0
68
73
68
self
[]
serializers.Serializer | None
{"If": 2, "Return": 2}
2
6
2
["ValueError", "GetPathSerializer"]
6
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.iterators.balanced_serial_iterator_py.BalancedSerialIterator.serialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_ch...
The function (serializer) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 68 and ends at 73. 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...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
example
def example(self):pass
1
2
1
6
0
77
78
77
self
[]
None
{}
0
2
0
[]
29
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3921115_iati_iati_datastore.iati_datastore.iatilib.test.test_serializers.test_csv_activities_py.TestActivityByCountry.example", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3921115_iati_iati_datastore.iati_datastor...
The function (example) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 77 and ends at 78. 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 an...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
create_triggers
def create_triggers(self, parent_class: Type[SQLModel], field_name: str):pass
1
2
3
17
0
81
82
81
self,parent_class,field_name
[]
None
{}
0
2
0
[]
0
[]
The function (create_triggers) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 81 and ends at 82. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [81.0] and does no...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
attribute
def attribute(self, attribute: str) -> str:"""Return the attribute belonging to this relationship (e.g. "description")For most relationships, this just returns the given attribute."""return attribute
1
2
2
14
0
84
87
84
self,attribute
[]
str
{"Expr": 1, "Return": 1}
0
4
0
[]
0
[]
The function (attribute) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 84 and ends at 87. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [84.0] and does not retu...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
attribute
def attribute(self, attribute: str) -> str:return self.identifier_name if self.identifier_name else attribute
2
2
2
21
0
105
106
105
self,attribute
[]
str
{"Expr": 1, "Return": 1}
0
4
0
[]
0
[]
The function (attribute) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 105 and ends at 106. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [105.0] and does not r...
aiondemand_AIOD-rest-api
_ResourceRelationshipList
protected
0
1
__post_init__
def __post_init__(self, example: list[Any] | None):"""Make sure the example is an empty list. If the example is None, Swagger will show itas [0] for a list[int], and [""] for a list[str]."""self.example = example if example is not None else []# type: ignore
2
2
2
28
0
120
123
120
self,example
[]
None
{"Assign": 1, "Expr": 1}
0
4
0
[]
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 protected class called _ResourceRelationshipList, that inherit another class.The function start at line 120 and ends at 123. It contains 2 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [120.0] and does not return any value. I...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
create_triggers
def create_triggers(self, parent_class: Type[SQLModel], field_name: str):if self.on_delete_trigger_deletion_by is not None:to_delete = datatype_of_field(parent_class, field_name)if isinstance(to_delete, str):raise ValueError("Deletion trigger is configured wrongly: field cannot use a forward reference "f"`{parent_class...
4
18
3
83
0
140
157
140
self,parent_class,field_name
[]
None
{}
0
2
0
[]
0
[]
The function (create_triggers) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 140 and ends at 157. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [140.0] and doe...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
create_triggers
def create_triggers(self, parent_class: Type[SQLModel], field_name: str):if self.on_delete_trigger_deletion_of_orphan is not None:to_delete_identifier = getattr(parent_class.RelationshipConfig, field_name).identifier_namereturn triggers.create_deletion_trigger_many_to_one(trigger=parent_class,to_delete=self.on_delete_t...
2
10
3
56
0
172
181
172
self,parent_class,field_name
[]
None
{}
0
2
0
[]
0
[]
The function (create_triggers) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 172 and ends at 181. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [172.0] and doe...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
create_triggers
def create_triggers(self, parent_class: Type[SQLModel], field_name: str):pass
1
1
3
17
0
190
191
81
self,parent_class,field_name
[]
None
{}
0
2
0
[]
0
[]
The function (create_triggers) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 190 and ends at 191. It contains 1 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [81.0] and does ...
aiondemand_AIOD-rest-api
_ResourceRelationship
protected
1
1
create_triggers
def create_triggers(self, parent_class: Type[SQLModel], field_name: str):if self.on_delete_trigger_orphan_deletion is not None:link = parent_class.__sqlmodel_relationships__[field_name].link_modelto_delete = datatype_of_field(parent_class, field_name)if isinstance(to_delete, str):raise ValueError("Deletion trigger is c...
4
18
3
101
0
207
225
207
self,parent_class,field_name
[]
None
{}
0
2
0
[]
0
[]
The function (create_triggers) defined within the protected class called _ResourceRelationship, implement an interface, and it inherit another class.The function start at line 207 and ends at 225. It contains 18 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [207.0] and doe...
aiondemand_AIOD-rest-api
public
public
0
0
_get_field_definitions_read
def _get_field_definitions_read(resource_class: Type["AIoDConcept"], relationships: dict[str, "_ResourceRelationship"]) -> dict[str, Tuple[Type, FieldInfo]]:if not hasattr(resource_class, "RelationshipConfig"):return {}annotations = all_annotations(resource_class.RelationshipConfig)return {attribute_name: (annotations[...
4
15
2
89
1
26
40
26
resource_class,relationships
['annotations']
dict[str, Tuple[Type, FieldInfo]]
{"Assign": 1, "If": 1, "Return": 2}
4
15
4
["hasattr", "all_annotations", "config.field", "relationships.items"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.resource_read_and_create_py.resource_read"]
The function (_get_field_definitions_read) defined within the public class called public.The function start at line 26 and ends at 40. It contains 15 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [26.0] and does not return any value. It declares 4.0 functions, It has 4.0 f...
aiondemand_AIOD-rest-api
public
public
0
0
_get_field_definitions_create
def _get_field_definitions_create(resource_class: Type["AIoDConcept"], relationships: dict[str, "_ResourceRelationship"]) -> dict[str, Tuple[Type, FieldInfo]]:if not hasattr(resource_class, "RelationshipConfig"):return {}annotations = all_annotations(resource_class.RelationshipConfig)return {attribute_name: (annotation...
5
16
2
93
1
43
58
43
resource_class,relationships
['annotations']
dict[str, Tuple[Type, FieldInfo]]
{"Assign": 1, "If": 1, "Return": 2}
4
16
4
["hasattr", "all_annotations", "config.field", "relationships.items"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.resource_read_and_create_py.resource_create"]
The function (_get_field_definitions_create) defined within the public class called public.The function start at line 43 and ends at 58. It contains 16 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [43.0] and does not return any value. It declares 4.0 functions, It has 4.0...
aiondemand_AIOD-rest-api
public
public
0
0
resource_create
def resource_create(resource_class: Type["AIoDConcept"] | Type["Platform"]) -> Type[SQLModel]:"""Create a SQLModel for a Create class of a resource. This Create class is a Pydantic classthat can be used for POST and PUT requests (and thus has no identifier), and is not backed by aORM table.Besides the default attribute...
1
7
1
56
3
62
79
62
resource_class
['relationships', 'field_definitions', 'model']
Type[SQLModel]
{"Assign": 3, "Expr": 1, "Return": 1}
3
18
3
["get_relationships", "_get_field_definitions_create", "create_model"]
11
["_.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 (resource_create) defined within the public class called public.The function start at line 62 and ends at 79. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions called ...
aiondemand_AIOD-rest-api
public
public
0
0
resource_read
def resource_read(resource_class: Type["AIoDConcept"] | Type["Platform"]) -> Type[SQLModel]:"""Create a SQLModel for a Read class of a resource. This Read class is a Pydantic classthat can be used for GET requests (and thus has a required identifier), and is not backed by aORM table.Besides the default attributes, this...
1
9
1
81
3
87
126
87
resource_class
['relationships', 'field_definitions', 'model']
Type[SQLModel]
{"Assign": 3, "Expr": 3, "Return": 1}
6
40
6
["get_relationships", "_get_field_definitions_read", "field_definitions.update", "Field", "create_model", "_update_model_serialization"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.project.project_py.project_v3_to_v2", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.resource_routers.platform_router...
The function (resource_read) defined within the public class called public.The function start at line 87 and ends at 126. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, It has 6.0 functions called i...
aiondemand_AIOD-rest-api
public
public
0
0
_update_model_serialization
def _update_model_serialization(resource_class: Type[SQLModel], resource_class_read):"""For every Serializer defined on the RelationshipConfig of the resource, use this Serializer ina newly created GetterDict (this is Pydantic functionality) and put in on the config of thisresource."""relationships = get_relationships(...
4
11
2
63
2
129
144
129
resource_class,resource_class_read
['relationships', 'getter_dict']
None
{"Assign": 3, "Expr": 1, "If": 1}
4
16
4
["get_relationships", "hasattr", "create_getter_dict", "relationships.items"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.resource_read_and_create_py.resource_read"]
The function (_update_model_serialization) defined within the public class called public.The function start at line 129 and ends at 144. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [129.0] and does not return any value. It declares 4.0 functions, It has 4....
aiondemand_AIOD-rest-api
Serializer
public
1
1
serialize
def serialize(self, model: MODEL) -> Any:pass
1
2
2
12
0
21
22
21
self,model
[]
Any
{}
0
2
0
[]
124
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.comment_py.Comment.serialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.note_py.Note.serialize", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (serialize) defined within the public class called Serializer, implement an interface, and it inherit another class.The function start at line 21 and ends at 22. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [21.0] and does not return any value. ...
aiondemand_AIOD-rest-api
Serializer
public
1
1
value
def value(self, model: SQLModel, attribute_name):"""Return the value, for most serializers just model.attribute_name"""return getattr(model, attribute_name)
1
2
3
19
0
24
26
24
self,model,attribute_name
[]
Returns
{"Expr": 1, "Return": 1}
1
3
1
["getattr"]
41
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.models.prediction.classifier_py.Classifier.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.models.pred...
The function (value) defined within the public class called Serializer, implement an interface, and it inherit another class.The function start at line 24 and ends at 26. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [24.0], and this function return a value. ...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, serialized: Any, user: KeycloakUser | None = None) -> int | None | MODEL | List[MODEL]:pass
1
4
4
33
0
33
36
33
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 33 and ends at 36. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [33.0] and does not return any val...
aiondemand_AIOD-rest-api
AttributeSerializer
public
0
1
__init__
def __init__(self, attribute_name: str):self.attribute_name = attribute_name
1
2
2
14
0
45
46
45
self,attribute_name
[]
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 AttributeSerializer, that inherit another class.The function start at line 45 and ends at 46. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [45.0] and does not return any value. It has 8182.0 func...
aiondemand_AIOD-rest-api
Serializer
public
1
1
serialize
def serialize(self, model: MODEL) -> Any:return getattr(model, self.attribute_name)
1
2
2
20
0
48
49
48
self,model
[]
Any
{}
0
2
0
[]
124
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.comment_py.Comment.serialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.note_py.Note.serialize", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (serialize) defined within the public class called Serializer, implement an interface, and it inherit another class.The function start at line 48 and ends at 49. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [48.0] and does not return any value. ...
aiondemand_AIOD-rest-api
AttributeSerializer
public
0
1
__init__
def __init__(self, path: str, inner_serializer: Serializer):self.path = pathself.other_serializer = inner_serializer
1
3
3
23
0
59
61
59
self,attribute_name
[]
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 AttributeSerializer, that inherit another class.The function start at line 59 and ends at 61. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [59.0] and does not return any value. It has 8182.0 func...
aiondemand_AIOD-rest-api
Serializer
public
1
1
serialize
def serialize(self, model: MODEL) -> Any:return getattr(model, self.attribute_name)
1
2
2
20
0
63
64
48
self,model
[]
Any
{}
0
2
0
[]
124
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.comment_py.Comment.serialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3573634_xray7224_pypump.pypump.models.note_py.Note.serialize", "_.content.gdrive.MyDrive.Phd_Thesis....
The function (serialize) defined within the public class called Serializer, implement an interface, and it 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 [48.0] and does not return any value. ...
aiondemand_AIOD-rest-api
Serializer
public
1
1
value
def value(self, model: SQLModel, attribute_name):"""Return the value: model.[self.path].attribute_name"""inner_model = getattr(model, self.path)return getattr(inner_model, attribute_name)
1
3
3
29
0
66
69
66
self,model,attribute_name
[]
Returns
{"Expr": 1, "Return": 1}
1
3
1
["getattr"]
41
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.models.prediction.classifier_py.Classifier.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3701896_chainer_chainer_chemistry.chainer_chemistry.models.pred...
The function (value) defined within the public class called Serializer, implement an interface, and it inherit another class.The function start at line 66 and ends at 69. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [66.0], and this function return a value. ...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, input_: int | None, user: KeycloakUser | None = None) -> SQLModel | None:if input_ is None:return Noneelif isinstance(input_, list):raise ValueError("Expected a single value. Do you need to use ""FindByIdentifierDeserializerList instead?")existing = FindByIdentifierDeserializer.d...
4
19
4
94
0
80
98
80
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 80 and ends at 98. It contains 19 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [80.0] and does not return any va...
aiondemand_AIOD-rest-api
FindByIdentifierDeserializer
public
0
1
deserialize_ids
def deserialize_ids(clazz: type[SQLModel], session: Session, ids: list[int]):query = select(clazz).where(clazz.identifier.in_(ids))# noqaexisting = session.scalars(query).all()ids_not_found = set(ids) - {e.identifier for e in existing}if any(ids_not_found):raise HTTPException(status_code=HTTP_404_NOT_FOUND,detail=f"Cou...
3
11
3
90
0
101
111
101
clazz,session,ids
[]
Returns
{"Assign": 3, "If": 1, "Return": 1}
10
11
10
["where", "select", "clazz.identifier.in_", "all", "session.scalars", "set", "any", "HTTPException", "join", "str"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.serializers_py.FindByIdentifierDeserializer.deserialize", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.seria...
The function (deserialize_ids) defined within the public class called FindByIdentifierDeserializer, that inherit another class.The function start at line 101 and ends at 111. It contains 11 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [101.0], and this function return a v...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, input_: list[int] | None, user: KeycloakUser | None = None) -> list[SQLModel]:if isinstance(input_, int):raise ValueError("Expected a list. Do you need to use FindByNameDeserializer instead?")elif input_ is None or len(input_) == 0:return []existing = FindByIdentifierDeserializer...
4
9
4
87
0
122
130
122
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 122 and ends at 130. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [122.0] and does not return any ...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, name: str | None, user: KeycloakUser | None = None) -> int | None:if name is None:return Noneif isinstance(name, list):raise ValueError("Expected a single value. Do you need to use FindByNameDeserializerList instead?")name = name.lower()query = select(self.clazz).where(self.clazz...
9
25
4
157
0
139
163
139
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 139 and ends at 163. It contains 25 lines of code and it has a cyclomatic complexity of 9. It takes 4 parameters, represented as [139.0] and does not return any...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, name: list[str] | None, user: KeycloakUser | None = None) -> list[NamedRelation]:if name is None:return []if not isinstance(name, list):raise ValueError("Expected a list. Do you need to use FindByNameDeserializer instead?")names = {n.casefold() for n in name}query = select(self.c...
13
26
4
221
0
172
197
172
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 172 and ends at 197. It contains 26 lines of code and it has a cyclomatic complexity of 13. It takes 4 parameters, represented as [172.0] and does not return an...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, serialized: Any, user: KeycloakUser | None = None) -> None | SQLModel:if serialized is None:return Noneif isinstance(serialized, list):raise ValueError("Expected a single value. Do you need to use CastDeserializerList instead?")return self._deserialize_single_resource(serialized,...
3
10
4
56
0
208
217
208
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 208 and ends at 217. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [208.0] and does not return any...
aiondemand_AIOD-rest-api
CastDeserializer
public
0
1
_deserialize_single_resource
def _deserialize_single_resource(self, serialized, session, user):resource = self.clazz.from_orm(serialized)deserialize_resource_relationships(session, self.clazz, resource, serialized, user)return resource
1
4
4
37
0
219
222
219
self,serialized,session,user
[]
Returns
{"Assign": 1, "Expr": 1, "Return": 1}
2
4
2
["self.clazz.from_orm", "deserialize_resource_relationships"]
0
[]
The function (_deserialize_single_resource) defined within the public class called CastDeserializer, that inherit another class.The function start at line 219 and ends at 222. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [219.0], and this function return a v...
aiondemand_AIOD-rest-api
DeSerializer
public
1
1
deserialize
def deserialize(self, session: Session, serialized: list | None, user: KeycloakUser | None = None) -> list[SQLModel]:if serialized is None:return []if not isinstance(serialized, list):raise ValueError("Expected a list. Do you need to use CastDeserializer instead?")return [self._deserialize_single_resource(v, session, u...
4
8
4
67
0
232
239
232
self,session,serialized,user
[]
int | None | MODEL | List[MODEL]
{}
0
4
0
[]
22
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_collection", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.schemas.geom_py.GeoJSONType._check_coordinates"...
The function (deserialize) defined within the public class called DeSerializer, implement an interface, and it inherit another class.The function start at line 232 and ends at 239. It contains 8 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [232.0] and does not return any ...
aiondemand_AIOD-rest-api
public
public
0
0
create_getter_dict.get
def get(self, key: Any, default: Any = None) -> Any:# if key == "has_part" and hasattr(self._obj, "ai_resource"):# return [p.identifier for p in self._obj.ai_resource.has_part]if key in attribute_names:serializer = attribute_serializers[key]attribute_value = serializer.value(model=self._obj, attribute_name=key)if attri...
5
9
3
89
0
252
262
252
null
[]
None
null
0
0
0
null
0
null
The function (create_getter_dict.get) defined within the public class called public.The function start at line 252 and ends at 262. It contains 9 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [252.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create_getter_dict
def create_getter_dict(attribute_serializers: Dict[str, Serializer]):"""Based on a dictionary of `variable_name, Serializer`, generate a `getter_dict`. A`getter_dict` is used by Pydantic to perform serialization.We have added a layer of Serializers instead of directly using a getter_dict, to make iteasier to configure ...
1
5
1
33
3
242
264
242
attribute_serializers
['attribute_names', 'serializer', 'attribute_value']
Returns
{"Assign": 3, "Expr": 1, "If": 3, "Return": 4}
8
23
8
["set", "attribute_serializers.keys", "serializer.value", "isinstance", "serializer.serialize", "serializer.serialize", "get", "super"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.resource_read_and_create_py._update_model_serialization"]
The function (create_getter_dict) defined within the public class called public.The function start at line 242 and ends at 264. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 8.0 functions, It has 8.0 function...
aiondemand_AIOD-rest-api
public
public
0
0
deserialize_resource_relationships
def deserialize_resource_relationships(session: Session,resource_class: Type[SQLModel],resource: SQLModel,resource_create_instance: SQLModel,user: KeycloakUser | None = None,):"""After deserialization of a resource, this function will deserialize all it's relatedobjects in place."""if not hasattr(resource_class, "Relat...
19
52
5
343
4
267
340
267
session,resource_class,resource,resource_create_instance,user
['relationships', 'inner_model', 'new_value', 'relation']
None
{"Assign": 9, "Expr": 10, "For": 2, "If": 11, "Return": 1}
27
74
27
["hasattr", "get_relationships", "relationships.items", "isinstance", "hasattr", "getattr", "deserialize_object_relationship", "getattr", "relationship.default_factory_orm", "session.add", "session.flush", "relationship.deserializer.deserialize", "setattr", "relationship.attribute", "getattr", "hasattr", "ValueError", ...
7
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.serializers_py.CastDeserializer._deserialize_single_resource", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model....
The function (deserialize_resource_relationships) defined within the public class called public.The function start at line 267 and ends at 340. It contains 52 lines of code and it has a cyclomatic complexity of 19. It takes 5 parameters, represented as [267.0] and does not return any value. It declares 27.0 functions, ...
aiondemand_AIOD-rest-api
public
public
0
0
deserialize_object_relationship
def deserialize_object_relationship(session, resource, resource_create_instance, attribute, user: KeycloakUser | None = None):"""In place deserialization of an object relationship (a relationship to an object that iscompletely present in the json, instead of linked using an identifier).e.g., AIoDEntry or AIoDResource."...
7
23
5
186
7
343
371
343
session,resource,resource_create_instance,attribute,user
['child', 'children_create', 'n_existing', 'children', 'child_value', 'child_class', 'n_create']
None
{"Assign": 9, "Expr": 6, "For": 4, "If": 2}
16
29
16
["getattr", "getattr", "isinstance", "type", "zip", "child_class.schema", "hasattr", "getattr", "setattr", "deserialize_resource_relationships", "len", "session.delete", "len", "child_class.from_orm", "deserialize_resource_relationships", "children.append"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.serializers_py.deserialize_resource_relationships"]
The function (deserialize_object_relationship) defined within the public class called public.The function start at line 343 and ends at 371. It contains 23 lines of code and it has a cyclomatic complexity of 7. It takes 5 parameters, represented as [343.0] and does not return any value. It declares 16.0 functions, It h...
aiondemand_AIOD-rest-api
Agent
public
0
1
__init_subclass__
def __init_subclass__(cls):"""Fixing problems with the inheritance of relationships, and creating linking tables.The latter cannot be done in the class variables, because it depends on the table-name ofthe child class."""cls.__annotations__.update(Agent.__annotations__)relationships = copy.deepcopy(Agent.__sqlmodel_rel...
1
5
1
40
0
31
40
31
cls
[]
None
{"Assign": 1, "Expr": 4}
4
10
4
["cls.__annotations__.update", "copy.deepcopy", "cls.update_relationships", "cls.__sqlmodel_relationships__.update"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963793_home_assistant_libs_aioshelly.aioshelly.block_device.device_py.Block.__init_subclass__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77580766_uninett_argus.src.argus.auth.models_py.Preferences.__init_subcl...
The function (__init_subclass__) defined within the public class called Agent, that inherit another class.The function start at line 31 and ends at 40. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions,...
aiondemand_AIOD-rest-api
Contact
public
0
1
contact_name
def contact_name(self) -> str | None:if self.organisation and self.organisation.legal_name:return self.organisation.legal_nameif self.person and (self.person.surname or self.person.given_name):return ", ".join([name for name in (self.person.surname, self.person.given_name) if name])return self.name
8
8
1
76
0
94
101
94
self
[]
str | None
{"If": 2, "Return": 3}
1
8
1
["join"]
0
[]
The function (contact_name) defined within the public class called Contact, that inherit another class.The function start at line 94 and ends at 101. It contains 8 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It declare 1.0 function, and...
aiondemand_AIOD-rest-api
Address
public
0
1
use_country_name
def use_country_name(cls, v) -> str | None:if v is None or isinstance(v, str):return vif isinstance(v, Country):return v.nameraise TypeError(f"Expected country to be `str` or `Country`, not {type(v)}.")
4
6
2
43
0
116
121
116
cls,v
[]
str | None
{"If": 2, "Return": 2}
5
6
5
["isinstance", "isinstance", "TypeError", "type", "validator"]
0
[]
The function (use_country_name) defined within the public class called Address, that inherit another class.The function start at line 116 and ends at 121. It contains 6 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [116.0] and does not return any value. It declares 5.0 fun...
aiondemand_AIOD-rest-api
AIAsset
public
0
1
__init_subclass__
def __init_subclass__(cls):"""Fixing problems with the inheritance of relationships, and creating linking tables.The latter cannot be done in the class variables, because it depends on the table-name ofthe child class."""cls.__annotations__.update(AIAsset.__annotations__)relationships = copy.deepcopy(AIAsset.__sqlmodel...
2
7
1
50
0
55
66
55
cls
[]
None
{"Assign": 2, "Expr": 4, "If": 1}
4
12
4
["cls.__annotations__.update", "copy.deepcopy", "cls.update_relationships_asset", "cls.__sqlmodel_relationships__.update"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963793_home_assistant_libs_aioshelly.aioshelly.block_device.device_py.Block.__init_subclass__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77580766_uninett_argus.src.argus.auth.models_py.Preferences.__init_subcl...
The function (__init_subclass__) defined within the public class called AIAsset, that inherit another class.The function start at line 55 and ends at 66. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 function...
aiondemand_AIOD-rest-api
public
public
0
0
update_relationships_asset.get_identifier
def get_identifier():from database.model.knowledge_asset.publication import Publicationreturn Publication.identifier
1
3
0
18
0
114
117
114
null
[]
None
null
0
0
0
null
0
null
The function (update_relationships_asset.get_identifier) defined within the public class called public.The function start at line 114 and ends at 117. 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
AIAsset
public
0
1
update_relationships_asset
def update_relationships_asset(cls, relationships: dict):cls.update_relationships(relationships)factory = (distribution_factoryif cls.__tablename__ not in ("ml_model", "experiment")else runnable_distribution_factory)distribution: Any = factory(table_from=cls.__tablename__)cls.__annotations__["distribution"] = list[dist...
3
27
2
172
0
91
124
91
cls,relationships
[]
Returns
{"AnnAssign": 1, "Assign": 7, "Expr": 1, "If": 1, "Return": 1}
8
34
8
["cls.update_relationships", "factory", "copy.copy", "CastDeserializerList", "many_to_many_link_factory", "dict", "get_identifier", "get_identifier"]
0
[]
The function (update_relationships_asset) defined within the public class called AIAsset, that inherit another class.The function start at line 91 and ends at 124. It contains 27 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [91.0], and this function return a value. It dec...
aiondemand_AIOD-rest-api
public
public
0
0
distribution_factory
def distribution_factory(table_from: str, distribution_name="distribution") -> Type:name = f"{distribution_name}_{table_from}"DistributionORM = create_model(name,__base__=(DistributionBase,),__cls_kwargs__=dict(table=True),identifier=(int | None, Field(primary_key=True)),asset_identifier=(str | None,Field(sa_column=Col...
1
19
2
96
2
66
85
66
table_from,distribution_name
['DistributionORM', 'name']
Type
{"Assign": 3, "Return": 1}
7
20
7
["create_model", "dict", "Field", "Field", "Column", "String", "ForeignKey"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.ai_resource.resource_py.AIResource.update_relationships"]
The function (distribution_factory) defined within the public class called public.The function start at line 66 and ends at 85. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [66.0] and does not return any value. It declares 7.0 functions, It has 7.0 function...
aiondemand_AIOD-rest-api
public
public
0
0
note_factory
def note_factory(table_from: str) -> Type:NoteORM = create_model(f"note_{table_from}",__base__=(NoteBase,),__cls_kwargs__=dict(table=True),identifier=(int | None, Field(primary_key=True)),linked_identifier=(str | None,Field(sa_column=Column(String(IDENTIFIER_LENGTH),ForeignKey(table_from + ".identifier", ondelete="CASC...
1
18
1
90
1
21
39
21
table_from
['NoteORM']
Type
{"Assign": 2, "Return": 1}
7
19
7
["create_model", "dict", "Field", "Field", "Column", "String", "ForeignKey"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.database.model.ai_resource.resource_py.AIResource.update_relationships"]
The function (note_factory) defined within the public class called public.The function start at line 21 and ends at 39. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, It has 7.0 functions called in...
aiondemand_AIOD-rest-api
AIResource
public
0
1
__init_subclass__
def __init_subclass__(cls):"""Fixing problems with the inheritance of relationships, and creating linking tables.The latter cannot be done in the class variables, because it depends on the table-name ofthe child class."""cls.__annotations__.update(AIResource.__annotations__)relationships = copy.deepcopy(AIResource.__sq...
2
7
1
57
0
91
102
91
cls
[]
None
{"Assign": 2, "Expr": 4, "If": 1}
4
12
4
["cls.__annotations__.update", "copy.deepcopy", "cls.update_relationships", "cls.__sqlmodel_relationships__.update"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963793_home_assistant_libs_aioshelly.aioshelly.block_device.device_py.Block.__init_subclass__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77580766_uninett_argus.src.argus.auth.models_py.Preferences.__init_subcl...
The function (__init_subclass__) defined within the public class called AIResource, that inherit another class.The function start at line 91 and ends at 102. It contains 7 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 func...
aiondemand_AIOD-rest-api
AIResource
public
0
1
update_relationships
def update_relationships(cls, relationships: dict[str, Any]):distribution: Any = distribution_factory(table_from=cls.__tablename__, distribution_name="media")cls.__annotations__["media"] = list[distribution]cls.RelationshipConfig.media = copy.copy(cls.RelationshipConfig.media)distribution_deserializer = CastDeserialize...
2
44
2
262
0
246
293
246
cls,relationships
[]
None
{"AnnAssign": 2, "Assign": 14, "For": 1}
10
48
10
["distribution_factory", "copy.copy", "CastDeserializerList", "note_factory", "copy.copy", "CastDeserializerList", "many_to_many_link_factory", "many_to_many_link_factory", "many_to_many_link_factory", "dict"]
0
[]
The function (update_relationships) defined within the public class called AIResource, that inherit another class.The function start at line 246 and ends at 293. It contains 44 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [246.0] and does not return any value. It declares...
aiondemand_AIOD-rest-api
AIoDConceptBase
public
0
1
platform_resource_identifier_valid
def platform_resource_identifier_valid(cls, platform_resource_identifier: str, values) -> str:"""Throw a ValueError if the platform_resource_identifier is invalid for this platform.Note that field order matters: platform is defined before platform_resource_identifier,so that this validator can use the value of the plat...
2
16
3
64
0
55
77
55
cls,platform_resource_identifier,values
[]
str
{"Expr": 4, "If": 1, "Return": 1}
5
23
5
["values.get", "huggingface_validators.throw_error_on_invalid_identifier", "openml_validators.throw_error_on_invalid_identifier", "zenodo_validators.throw_error_on_invalid_identifier", "validator"]
0
[]
The function (platform_resource_identifier_valid) defined within the public class called AIoDConceptBase, that inherit another class.The function start at line 55 and ends at 77. It contains 16 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [55.0] and does not return any va...
aiondemand_AIOD-rest-api
AIoDConcept
public
0
1
set_dynamic_default_identifier
def set_dynamic_default_identifier(cls, v) -> str:if isinstance(v, str):return vif not cls._id_generator:# TODO: Centralize validation probably, so we can check against duplicate abbreviationsabbreviation = getattr(cls, "__abbreviation__", None)if abbreviation is None:raise ValueError(f"{cls}.__abbreviation__ not set. ...
6
15
2
84
0
97
112
97
cls,v
[]
str
{"Assign": 2, "If": 4, "Return": 2}
9
16
9
["isinstance", "getattr", "ValueError", "isinstance", "len", "ValueError", "create_id_generator", "cls._id_generator", "validator"]
0
[]
The function (set_dynamic_default_identifier) defined within the public class called AIoDConcept, that inherit another class.The function start at line 97 and ends at 112. It contains 15 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [97.0] and does not return any value. It...
aiondemand_AIOD-rest-api
AIoDConcept
public
0
1
__init_subclass__
def __init_subclass__(cls):"""Fixing problems with the inheritance of relationships."""cls.__annotations__.update(AIoDConcept.__annotations__)relationships = copy.deepcopy(AIoDConcept.__sqlmodel_relationships__)cls.__sqlmodel_relationships__.update(relationships)
1
4
1
34
0
114
118
114
cls
[]
None
{"Assign": 1, "Expr": 3}
3
5
3
["cls.__annotations__.update", "copy.deepcopy", "cls.__sqlmodel_relationships__.update"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963793_home_assistant_libs_aioshelly.aioshelly.block_device.device_py.Block.__init_subclass__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77580766_uninett_argus.src.argus.auth.models_py.Preferences.__init_subcl...
The function (__init_subclass__) defined within the public class called AIoDConcept, that inherit another class.The function start at line 114 and ends at 118. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 fu...
aiondemand_AIOD-rest-api
AIoDConcept
public
0
1
table_arguments
def table_arguments(cls) -> list:"""This function can be implemented by children of this class, to add additional tablearguments"""return []
1
2
1
11
0
131
134
131
cls
[]
list
{"Expr": 1, "Return": 1}
0
4
0
[]
0
[]
The function (table_arguments) defined within the public class called AIoDConcept, that inherit another class.The function start at line 131 and ends at 134. 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
AIoDConcept
public
0
1
__table_args__
def __table_args__(cls) -> Tuple:return (Index(f"{cls.__name__}_same_platform_and_platform_id",cls.platform,cls.platform_resource_identifier,coalesce(cls.date_deleted, "2000-01-01"),unique=True,),CheckConstraint("(platform IS NULL) <> (platform_resource_identifier IS NOT NULL)",name=f"{cls.__name__}_platform_xnor_platf...
1
15
1
68
0
137
151
137
cls
[]
Tuple
{"Return": 1}
6
15
6
["Index", "coalesce", "CheckConstraint", "CheckConstraint", "tuple", "cls.table_arguments"]
0
[]
The function (__table_args__) defined within the public class called AIoDConcept, that inherit another class.The function start at line 137 and ends at 151. It contains 15 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 func...
aiondemand_AIOD-rest-api
KnowledgeAsset
public
0
1
__init_subclass__
def __init_subclass__(cls):"""Fixing problems with the inheritance of relationships, and creating linking tables.The latter cannot be done in the class variables, because it depends on the table-name ofthe child class."""cls.__annotations__.update(KnowledgeAsset.__annotations__)relationships = copy.deepcopy(KnowledgeAs...
1
12
1
72
0
32
49
32
cls
[]
None
{"Assign": 2, "Expr": 4}
5
18
5
["cls.__annotations__.update", "copy.deepcopy", "cls.update_relationships_asset", "many_to_many_link_factory", "cls.__sqlmodel_relationships__.update"]
11
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3963793_home_assistant_libs_aioshelly.aioshelly.block_device.device_py.Block.__init_subclass__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.77580766_uninett_argus.src.argus.auth.models_py.Preferences.__init_subcl...
The function (__init_subclass__) defined within the public class called KnowledgeAsset, that inherit another class.The function start at line 32 and ends at 49. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 ...
aiondemand_AIOD-rest-api
public
public
0
0
runnable_distribution_factory
def runnable_distribution_factory(table_from: str, distribution_name="distribution") -> Type:RunnableDistributionORM = create_model(f"{distribution_name}_{table_from}",__base__=(RunnableDistributionBase,),__cls_kwargs__=dict(table=True),identifier=(int | None, Field(primary_key=True)),asset_identifier=(str | None,Field...
1
18
2
94
1
78
96
78
table_from,distribution_name
['RunnableDistributionORM']
Type
{"Assign": 2, "Return": 1}
7
19
7
["create_model", "dict", "Field", "Field", "Column", "String", "ForeignKey"]
0
[]
The function (runnable_distribution_factory) defined within the public class called public.The function start at line 78 and ends at 96. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [78.0] and does not return any value. It declares 7.0 functions, and It ha...
aiondemand_AIOD-rest-api
public
public
0
0
project_v3_to_v2.orm_to_read
def orm_to_read(project: Project) -> ProjectV2Read:# type: ignore[valid-type]read = resource_read(Project).model_validate(project).model_dump()read["total_cost_euro"] = project.total_cost_eurosreturn ProjectV2Read.model_validate(read)
1
4
1
39
0
145
148
145
null
[]
None
null
0
0
0
null
0
null
The function (project_v3_to_v2.orm_to_read) defined within the public class called public.The function start at line 145 and ends at 148. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
project_v3_to_v2.create_to_orm
def create_to_orm(project: ProjectV2Create) -> Project:# type: ignore[valid-type]fields = cast(SQLModel, project).model_dump()old = fields.get("total_cost_euro")new = fields.get("total_cost_euros")if (old and new) and old != new:raise ValueError("'total_cost_euro' and 'total_cost_euros' are both specified, but with dif...
5
10
1
68
0
150
161
150
null
[]
None
null
0
0
0
null
0
null
The function (project_v3_to_v2.create_to_orm) defined within the public class called public.The function start at line 150 and ends at 161. It contains 10 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
project_v3_to_v2
def project_v3_to_v2() -> VersionedResource:"""Name change: total_cost_euro -> total_cost_euros"""old_parameter = dict(total_cost_euro=(condecimal(max_digits=12, decimal_places=2) | None,Field(# type: ignoredescription="The total budget of the project in euros.",schema_extra={"example": 1000000},default=None,),),)Proje...
1
24
0
99
7
122
163
122
['fields', 'ProjectV2Create', 'read', 'ProjectV2Read', 'old_parameter', 'old', 'new']
VersionedResource
{"Assign": 9, "Expr": 1, "If": 1, "Return": 3}
18
42
18
["dict", "condecimal", "Field", "schema_transform", "resource_read", "schema_transform", "resource_create", "model_dump", "model_validate", "resource_read", "ProjectV2Read.model_validate", "model_dump", "cast", "fields.get", "fields.get", "ValueError", "Project.model_validate", "VersionedResource"]
0
[]
The function (project_v3_to_v2) defined within the public class called public.The function start at line 122 and ends at 163. It contains 24 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 18.0 functions, and It has 18.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
throw_error_on_invalid_identifier
def throw_error_on_invalid_identifier(platform_resource_identifier: str):"""Throw a ValueError on an invalid repository identifier.Valid repo_ids:Between 1 and 96 characters.Either “repo_name” or “namespace/repo_name”[a-zA-Z0-9] or ”-”, ”_”, ”.”.The following sequences ”--” and ”..” are forbidden.Refer to:https://huggi...
1
3
1
17
1
4
18
4
platform_resource_identifier
['repo_id']
None
{"Assign": 1, "Expr": 2}
1
15
1
["validate_repo_id"]
0
[]
The function (throw_error_on_invalid_identifier) defined within the public class called public.The function start at line 4 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. It declare 1.0 function, and It has 1...
aiondemand_AIOD-rest-api
public
public
0
0
throw_error_on_invalid_identifier
def throw_error_on_invalid_identifier(platform_resource_identifier: str):"""Throw a ValueError on an invalid repository identifier."""try:openml_identifier = int(platform_resource_identifier)except ValueError:raise ValueError(MSG)if openml_identifier < 0:raise ValueError(MSG)
3
7
1
34
1
4
11
4
platform_resource_identifier
['openml_identifier']
None
{"Assign": 1, "Expr": 1, "If": 1, "Try": 1}
3
8
3
["int", "ValueError", "ValueError"]
0
[]
The function (throw_error_on_invalid_identifier) defined within the public class called public.The function start at line 4 and ends at 11. 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, and It has...
aiondemand_AIOD-rest-api
public
public
0
0
throw_error_on_invalid_identifier
def throw_error_on_invalid_identifier(platform_resource_identifier: str):"""Throw a ValueError on an invalid repository or distribution identifier.Valid repository identifier is the string 'zenodo.org:' followed by an integer::zenodo.org:<int>Valid distribution identifier is a string composed by a group of 8 characters...
2
14
1
37
2
8
33
8
platform_resource_identifier
['repo_id', 'msg']
None
{"Assign": 2, "Expr": 1, "If": 1}
2
26
2
["PATTERN.match", "ValueError"]
0
[]
The function (throw_error_on_invalid_identifier) defined within the public class called public.The function start at line 8 and ends at 33. It contains 14 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It ha...
aiondemand_AIOD-rest-api
public
public
0
0
as_http_exception
def as_http_exception(exception: Exception) -> HTTPException:if isinstance(exception, HTTPException):return exceptiontraceback.print_exc()return HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,detail=("Unexpected exception while processing your request. Please contact the maintainers: "f"{exception}"),)
2
11
1
42
0
12
22
12
exception
[]
HTTPException
{"Expr": 1, "If": 1, "Return": 2}
3
11
3
["isinstance", "traceback.print_exc", "HTTPException"]
13
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.resource_router_py.ResourceRouter.delete_resource_func", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.resource_router_py.R...
The function (as_http_exception) defined within the public class called public.The function start at line 12 and ends at 22. It contains 11 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
http_exception_handler
async def http_exception_handler(request, exc):reference = uuid.uuid4().hexerror = ErrorSchema(detail=exc.detail, reference=reference)content = error.dict()body_content = "<Data Stream with unknown content>"if not request._stream_consumed:body = await request.body()body_content = json.dumps(json.loads(body)) if body el...
4
22
2
148
7
30
53
30
request,exc
['body_content', 'content', 'body', 'log_message', 'log_level', 'reference', 'error']
Returns
{"Assign": 9, "Expr": 1, "If": 2, "Return": 1}
11
24
11
["uuid.uuid4", "ErrorSchema", "error.dict", "request.body", "json.dumps", "json.loads", "str", "dict", "str", "logging.log", "JSONResponse"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95132408_UpstreamDataInc_goosebit.goosebit.__init___py.custom_http_exception_handler"]
The function (http_exception_handler) defined within the public class called public.The function start at line 30 and ends at 53. It contains 22 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [30.0], and this function return a value. It declares 11.0 functions, It has 11.0 ...
aiondemand_AIOD-rest-api
AccessLogMiddleware
public
0
1
dispatch
async def dispatch(self, request: Request, call_next):response: Response = await call_next(request)parsed = parse_asset_from_path(request.url.path)if parsed:resource_type, asset_id = parsedentry = AssetAccessLog(asset_id=asset_id,resource_type=resource_type,status=response.status_code,)with DbSession() as sess:sess.add...
2
14
3
77
0
13
28
13
self,request,call_next
[]
Returns
{"AnnAssign": 1, "Assign": 3, "Expr": 2, "If": 1, "Return": 1, "With": 1}
6
16
6
["call_next", "parse_asset_from_path", "AssetAccessLog", "DbSession", "sess.add", "sess.commit"]
25
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3527343_frigg_frigg_hq.frigg.webhooks.views_py.WebhookView.dispatch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3670679_blaze_datashape.datashape.discovery_py.discover", "_.content.gdrive.MyDrive.Phd_Thesis.Data...
The function (dispatch) defined within the public class called AccessLogMiddleware, that inherit another class.The function start at line 13 and ends at 28. It contains 14 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [13.0], and this function return a value. It declares 6...
aiondemand_AIOD-rest-api
public
public
0
0
parse_asset_from_path
def parse_asset_from_path(path: str) -> Optional[tuple[str, str]]:"""If the path represents direct asset access, return the asset type and identifier.Direct asset access means that an asset is requested by its identifier,either through the resource type's router or a different one (like the generic one).If the path doe...
4
14
1
113
7
23
52
23
path
['asset_type', 'prefix', 'asset_type_match', 'identifier_match', 'path', 'version_match', 'path_match']
Optional[tuple[str, str]]
{"Assign": 9, "Expr": 1, "If": 2, "Return": 2}
7
30
7
["DEV_CONFIG.get", "strip", "path.removeprefix", "join", "re.match", "match.groups", "identifier.split"]
3
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.middleware.access_log_py.AccessLogMiddleware.dispatch", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.middleware.test_path_parse_py.t...
The function (parse_asset_from_path) defined within the public class called public.The function start at line 23 and ends at 52. 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 ...
aiondemand_AIOD-rest-api
public
public
0
0
create.top_assets
def top_assets(resource_type: str, limit: int = Query(10, ge=1, le=1000)):stmt = (select(AssetAccessLog.asset_id,func.count().label("hits"),).where(AssetAccessLog.resource_type == resource_type,AssetAccessLog.status == 200,).group_by(AssetAccessLog.asset_id).order_by(func.count().desc()).limit(limit))with DbSession() a...
2
17
4
131
0
13
30
13
null
[]
None
null
0
0
0
null
0
null
The function (create.top_assets) defined within the public class called public.The function start at line 13 and ends at 30. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [13.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create.top_all
def top_all(limit_per_type: int = Query(20, ge=1, le=1000)):ranked = (select(AssetAccessLog.resource_type,AssetAccessLog.asset_id,func.count().label("hits"),func.row_number().over(partition_by=AssetAccessLog.resource_type,order_by=func.count().desc(),).label("rnk"),).where(AssetAccessLog.status == 200).group_by(AssetAc...
2
22
3
188
0
33
57
33
null
[]
None
null
0
0
0
null
0
null
The function (create.top_all) defined within the public class called public.The function start at line 33 and ends at 57. It contains 22 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [33.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create
def create(url_prefix: str = "") -> APIRouter:router = APIRouter(prefix=f"{url_prefix}/stats", tags=["stats"])@router.get("/top/{resource_type}")def top_assets(resource_type: str, limit: int = Query(10, ge=1, le=1000)):stmt = (select(AssetAccessLog.asset_id,func.count().label("hits"),).where(AssetAccessLog.resource_typ...
1
7
1
46
4
9
59
9
url_prefix
['rows', 'ranked', 'router', 'stmt']
APIRouter
{"Assign": 6, "Return": 3, "With": 2}
35
51
35
["APIRouter", "Query", "limit", "order_by", "group_by", "where", "select", "label", "func.count", "desc", "func.count", "DbSession", "all", "s.exec", "int", "router.get", "Query", "subquery", "group_by", "where", "select", "label", "func.count", "label", "over", "func.row_number", "desc", "func.count", "where", "select...
158
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3527343_frigg_frigg_hq.frigg.deployments.managers_py.PRDeploymentManager.create", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3635000_umutbozkurt_django_rest_framework_mongoengine.tests.test_reference_py.ComboRefe...
The function (create) defined within the public class called public.The function start at line 9 and ends at 59. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 35.0 functions, It has 35.0 functions called inside w...
aiondemand_AIOD-rest-api
public
public
0
0
create.asset
def asset(identifier: str,session: Session = Depends(get_session),user: KeycloakUser = Depends(get_user_or_none),):"""Get the resource identified by AIoD identifier, return in aiod schema."""asset_type_map = get_asset_type_by_abbreviation()prefix = identifier.split("_")[0]model_class = asset_type_map.get(prefix)if not ...
9
37
2
203
0
22
67
22
null
[]
None
null
0
0
0
null
0
null
The function (create.asset) defined within the public class called public.The function start at line 22 and ends at 67. It contains 37 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [22.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create
def create(url_prefix: str = "", version: Version = Version.LATEST) -> APIRouter:router = APIRouter()@router.get(f"/assets/{{identifier}}",tags=["Assets"],description="Fetch any asset by its identifier.",)def asset(identifier: str,session: Session = Depends(get_session),user: KeycloakUser = Depends(get_user_or_none),):...
1
9
2
47
5
14
69
14
url_prefix,version
['prefix', 'resource', 'router', 'asset_type_map', 'model_class']
APIRouter
{"Assign": 5, "Expr": 1, "For": 1, "If": 6, "Return": 2}
16
56
16
["APIRouter", "Depends", "Depends", "get_asset_type_by_abbreviation", "identifier.split", "asset_type_map.get", "HTTPException", "session.get", "HTTPException", "HTTPException", "user_can_read", "HTTPException", "versioned_routers.get", "router.orm_to_read", "HTTPException", "router.get"]
158
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3527343_frigg_frigg_hq.frigg.deployments.managers_py.PRDeploymentManager.create", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3635000_umutbozkurt_django_rest_framework_mongoengine.tests.test_reference_py.ComboRefe...
The function (create) defined within the public class called public.The function start at line 14 and ends at 69. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [14.0] and does not return any value. It declares 16.0 functions, It has 16.0 functions called insi...
aiondemand_AIOD-rest-api
public
public
0
0
create.list_bookmarks
def list_bookmarks(pagination: PaginationParams,user: KeycloakUser = Depends(get_user_or_raise),session: Session = Depends(get_session),) -> List[BookmarkRead]:stmt = (select(Bookmark).where(Bookmark.user_identifier == user._subject_identifier).offset(pagination.offset).limit(pagination.limit))return session.exec(stmt)...
1
12
2
75
0
43
54
43
null
[]
None
null
0
0
0
null
0
null
The function (create.list_bookmarks) defined within the public class called public.The function start at line 43 and ends at 54. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [43.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create.create_bookmark
def create_bookmark(resource_identifier: str,user: KeycloakUser = Depends(get_user_or_raise),session: Session = Depends(get_session),) -> BookmarkRead:if not resource_identifier_exists_in_database(resource_identifier, session):raise HTTPException(status_code=HTTPStatus.NOT_FOUND,detail=f"Resource {resource_identifier} ...
4
28
2
149
0
64
93
64
null
[]
None
null
0
0
0
null
0
null
The function (create.create_bookmark) defined within the public class called public.The function start at line 64 and ends at 93. It contains 28 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [64.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create.delete_bookmark
def delete_bookmark(resource_identifier: str,user: KeycloakUser = Depends(get_user_or_raise),session: Session = Depends(get_session),):bookmark = session.get(Bookmark, (user._subject_identifier, resource_identifier))if bookmark:session.delete(bookmark)session.commit()return None
2
10
2
58
0
102
111
102
null
[]
None
null
0
0
0
null
0
null
The function (create.delete_bookmark) defined within the public class called public.The function start at line 102 and ends at 111. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [102.0] and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
create
def create(url_prefix: str = "", version: Version = Version.LATEST) -> APIRouter:router = APIRouter()path = "/bookmarks"@router.get(path,tags=["User"],description="Return all your bookmarks.",response_model=List[BookmarkRead],)def list_bookmarks(pagination: PaginationParams,user: KeycloakUser = Depends(get_user_or_rais...
1
28
2
114
4
33
113
33
url_prefix,version
['stmt', 'bookmark', 'router', 'path']
APIRouter
{"Assign": 6, "Expr": 7, "If": 3, "Return": 4, "Try": 1}
30
81
30
["APIRouter", "Depends", "Depends", "limit", "offset", "where", "select", "all", "session.exec", "router.get", "Depends", "Depends", "resource_identifier_exists_in_database", "HTTPException", "register_user", "Bookmark", "session.add", "session.commit", "session.rollback", "session.get", "logger.warning", "HTTPExceptio...
158
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3527343_frigg_frigg_hq.frigg.deployments.managers_py.PRDeploymentManager.create", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3635000_umutbozkurt_django_rest_framework_mongoengine.tests.test_reference_py.ComboRefe...
The function (create) defined within the public class called public.The function start at line 33 and ends at 113. It contains 28 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [33.0] and does not return any value. It declares 30.0 functions, It has 30.0 functions called in...
aiondemand_AIOD-rest-api
public
public
0
0
resource_identifier_exists_in_database
def resource_identifier_exists_in_database(resource_identifier: str, session: Session) -> bool:"""Returns True if the given identifier exists in any of the tables."""asset_type = get_asset_type_by_abbreviation().get(resource_identifier.split("_")[0], None)if asset_type:query = select(asset_type).where(asset_type.identi...
2
6
2
68
2
116
125
116
resource_identifier,session
['asset_type', 'query']
bool
{"Assign": 2, "Expr": 1, "If": 1, "Return": 2}
7
10
7
["get", "get_asset_type_by_abbreviation", "resource_identifier.split", "where", "select", "first", "session.exec"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.bookmark_router_py.create"]
The function (resource_identifier_exists_in_database) defined within the public class called public.The function start at line 116 and ends at 125. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [116.0] and does not return any value. It declares 7.0 functions,...
aiondemand_AIOD-rest-api
public
public
0
0
get_all_read_classes
def get_all_read_classes(version: Version = Version.LATEST) -> dict[str, AIoDConcept]:"""Returns a list of all schema types and a reference to their definition."""from routers.resource_routers import versioned_routers# avoid cyclical importavailable_schemas: list[AIoDConcept] = list(non_abstract_subclasses(AIoDConcept)...
6
10
1
96
2
12
23
12
version
['resrouters', 'classes_dict']
dict[str, AIoDConcept]
{"AnnAssign": 1, "Assign": 2, "Expr": 1, "Return": 1}
2
12
2
["list", "non_abstract_subclasses"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.helper_functions_py.get_all_asset_schemas", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.routers.user_router_py.create"]
The function (get_all_read_classes) defined within the public class called public.The function start at line 12 and ends at 23. It contains 10 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 2.0 functions, It has 2.0 functions c...