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
test_a_submitted_asset_is_pending_for_review
def test_a_submitted_asset_is_pending_for_review(client, publication):register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)with logged_in_user(REVIEWER):queue = client.get("/submissions", headers={"Authorization": "Fake token"})assert queue.status_code == HTTPStatus.OK, queue.json()assert len(queue.jso...
1
6
2
70
1
177
183
177
client,publication
['queue']
None
{"Assign": 1, "Expr": 1, "With": 1}
6
7
6
["register_asset", "logged_in_user", "client.get", "queue.json", "len", "queue.json"]
0
[]
The function (test_a_submitted_asset_is_pending_for_review) defined within the public class called public.The function start at line 177 and ends at 183. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [177.0] and does not return any value. It declares 6.0 func...
aiondemand_AIOD-rest-api
public
public
0
0
test_get_submission_by_id
def test_get_submission_by_id(client, publication):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.PUBLISHED)with logged_in_user(REVIEWER):submission = client.get("/submissions/1", headers={"Authorization": "Fake token"})assert submission.status_code == HTTPStatus.OK, submission.json()submissio...
1
25
2
162
8
185
212
185
client,publication
['reviews', 'assets', 'publication_json', 'review_date', 'submission_dict', 'submission', 'identifier', 'submission_date']
None
{"Assign": 8, "With": 1}
11
28
11
["register_asset", "logged_in_user", "client.get", "submission.json", "submission.json", "submission_dict.pop", "pop", "submission_dict.pop", "submission_dict.pop", "json.loads", "publication.json"]
0
[]
The function (test_get_submission_by_id) defined within the public class called public.The function start at line 185 and ends at 212. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [185.0] and does not return any value. It declares 11.0 functions, and It ha...
aiondemand_AIOD-rest-api
public
public
0
0
test_get_submission_by_id_must_be_reviewer_or_owner
def test_get_submission_by_id_must_be_reviewer_or_owner(client, publication):register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)_register_user_in_db(REVIEWER)_register_user_in_db(BOB)for allowed_user in [REVIEWER, ALICE]:with logged_in_user(allowed_user):submission = client.get("/submissions/1", head...
2
11
2
106
1
215
228
215
client,publication
['submission']
None
{"Assign": 2, "Expr": 3, "For": 1, "With": 2}
8
14
8
["register_asset", "_register_user_in_db", "_register_user_in_db", "logged_in_user", "client.get", "submission.json", "logged_in_user", "client.get"]
0
[]
The function (test_get_submission_by_id_must_be_reviewer_or_owner) defined within the public class called public.The function start at line 215 and ends at 228. It contains 11 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [215.0] and does not return any value. It declares ...
aiondemand_AIOD-rest-api
public
public
0
0
test_unknown_submission_raises_404
def test_unknown_submission_raises_404(client):with logged_in_user(REVIEWER):queue = client.get("/submissions/1", headers={"Authorization": "Fake token"})assert queue.status_code == HTTPStatus.NOT_FOUND
1
4
1
35
1
231
234
231
client
['queue']
None
{"Assign": 1, "With": 1}
2
4
2
["logged_in_user", "client.get"]
0
[]
The function (test_unknown_submission_raises_404) defined within the public class called public.The function start at line 231 and ends at 234. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It...
aiondemand_AIOD-rest-api
public
public
0
0
test_submission_by_state_respects_privacy
def test_submission_by_state_respects_privacy(user: KeycloakUser, mode: ListMode, assets: list[int], reason: str, client: TestClient, publication):register_asset(publication, owner=ALICE, status=EntryStatus.PUBLISHED)register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)register_asset(publication, owner...
2
9
6
130
2
251
260
251
user,mode,assets,reason,client,publication
['queue', 'returned_submissions']
None
{"Assign": 2, "Expr": 3, "With": 1}
9
10
9
["register_asset", "register_asset", "register_asset", "logged_in_user", "client.get", "queue.json", "queue.json", "queue.json", "pytest.mark.parametrize"]
0
[]
The function (test_submission_by_state_respects_privacy) defined within the public class called public.The function start at line 251 and ends at 260. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 6 parameters, represented as [251.0] and does not return any value. It declares 9.0 functio...
aiondemand_AIOD-rest-api
public
public
0
0
test_an_published_asset_is_not_pending_for_review
def test_an_published_asset_is_not_pending_for_review(client, publication):register_asset(publication, owner=ALICE, status=EntryStatus.PUBLISHED)with logged_in_user(REVIEWER):queue = client.get(f"/submissions?mode={ListMode.PENDING}", headers={"Authorization": "Fake token"})assert queue.status_code == HTTPStatus.OK, qu...
1
15
2
117
1
263
279
263
client,publication
['queue']
None
{"Assign": 2, "Expr": 1, "With": 1}
10
17
10
["register_asset", "logged_in_user", "client.get", "queue.json", "len", "queue.json", "client.get", "queue.json", "len", "queue.json"]
0
[]
The function (test_an_published_asset_is_not_pending_for_review) defined within the public class called public.The function start at line 263 and ends at 279. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [263.0] and does not return any value. It declares 10...
aiondemand_AIOD-rest-api
public
public
0
0
test_retrieving_single_submission_works
def test_retrieving_single_submission_works(user: KeycloakUser, mode: ListMode, asset: int, reason: str, client: TestClient, publication_factory):publication = publication_factory()oldest = publication_factory()newest = publication_factory()register_asset(publication, owner=ALICE, status=EntryStatus.PUBLISHED)register_...
1
11
6
135
4
293
305
293
user,mode,asset,reason,client,publication_factory
['queue', 'oldest', 'newest', 'publication']
None
{"Assign": 4, "Expr": 3, "With": 1}
11
13
11
["publication_factory", "publication_factory", "publication_factory", "register_asset", "register_asset", "register_asset", "logged_in_user", "client.get", "queue.json", "queue.json", "pytest.mark.parametrize"]
0
[]
The function (test_retrieving_single_submission_works) defined within the public class called public.The function start at line 293 and ends at 305. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [293.0] and does not return any value. It declares 11.0 functio...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_can_retract_assets
def test_user_can_retract_assets(client, publication):register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)with logged_in_user(ALICE):response = client.post(f"/submissions/retract/1", headers={"Authorization": "Fake token"})assert "review_identifier" in response.json()assert Decision.RETRACTED == respo...
1
14
2
115
2
308
322
308
client,publication
['queue', 'response']
None
{"Assign": 2, "Expr": 1, "With": 2}
10
15
10
["register_asset", "logged_in_user", "client.post", "response.json", "response.json", "logged_in_user", "client.get", "queue.json", "len", "queue.json"]
0
[]
The function (test_user_can_retract_assets) defined within the public class called public.The function start at line 308 and ends at 322. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [308.0] and does not return any value. It declares 10.0 functions, and It...
aiondemand_AIOD-rest-api
public
public
0
0
test_other_user_can_not_retract_assets
def test_other_user_can_not_retract_assets(client, publication):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)with logged_in_user(BOB):response = client.post(f"/submissions/retract/1", headers={"Authorization": "Fake token"})assert response.status_code == HTTPStatus.FORBIDDEN, respo...
1
7
2
60
2
325
332
325
client,publication
['identifier', 'response']
None
{"Assign": 2, "With": 1}
4
8
4
["register_asset", "logged_in_user", "client.post", "response.json"]
0
[]
The function (test_other_user_can_not_retract_assets) defined within the public class called public.The function start at line 325 and ends at 332. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [325.0] and does not return any value. It declares 4.0 functions,...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_needs_only_one_asset_to_retract
def test_user_needs_only_one_asset_to_retract(client, publication_factory):own = register_asset(publication_factory(), owner=ALICE, status=EntryStatus.DRAFT)bobs_publication = publication_factory()other = register_asset(bobs_publication, owner=BOB, status=EntryStatus.DRAFT)with DbSession() as session:session.add(bobs_p...
1
25
2
196
6
335
361
335
client,publication_factory
['submission_identifier', 'bobs_publication', 'own', 'other', 'submission', 'reason']
None
{"AnnAssign": 1, "Assign": 7, "Expr": 3, "With": 3}
13
27
13
["register_asset", "publication_factory", "publication_factory", "register_asset", "DbSession", "session.add", "set_permission", "session.commit", "logged_in_user", "client.post", "submission.json", "logged_in_user", "client.post"]
0
[]
The function (test_user_needs_only_one_asset_to_retract) defined within the public class called public.The function start at line 335 and ends at 361. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [335.0] and does not return any value. It declares 13.0 funct...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_can_always_delete_asset
def test_user_can_always_delete_asset(status: EntryStatus, publication, client):identifier = register_asset(publication, owner=ALICE, status=status)with logged_in_user(ALICE):response = client.delete(f"/publications/{identifier}",headers={"Authorization": "Fake token"},)assert response.status_code == HTTPStatus.OK, res...
1
8
3
63
2
365
373
365
status,publication,client
['identifier', 'response']
None
{"Assign": 2, "With": 1}
5
9
5
["register_asset", "logged_in_user", "client.delete", "response.json", "pytest.mark.parametrize"]
0
[]
The function (test_user_can_always_delete_asset) defined within the public class called public.The function start at line 365 and ends at 373. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [365.0] and does not return any value. It declares 5.0 functions, and ...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_can_edit_asset_in_draft
def test_user_can_edit_asset_in_draft(publication, client):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.DRAFT)new_name = "Alice in Wonderland"with logged_in_user(ALICE):response = client.put(f"/publications/{identifier}",content=f'{{"name": "{new_name}"}}',headers={"Authorization": "Fake tok...
1
15
2
98
4
376
391
376
publication,client
['updated_publication', 'identifier', 'response', 'new_name']
None
{"Assign": 4, "With": 1}
6
16
6
["register_asset", "logged_in_user", "client.put", "response.json", "json", "client.get"]
0
[]
The function (test_user_can_edit_asset_in_draft) defined within the public class called public.The function start at line 376 and ends at 391. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [376.0] and does not return any value. It declares 6.0 functions, and...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_cannot_edit_asset_in_submission
def test_user_cannot_edit_asset_in_submission(publication, client):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)new_name = "Alice in Wonderland"with logged_in_user(ALICE):response = client.put(f"/publications/{identifier}",content=f'{{"name": "{new_name}"}}',headers={"Authorization...
1
10
2
69
3
394
404
394
publication,client
['identifier', 'response', 'new_name']
None
{"Assign": 3, "With": 1}
4
11
4
["register_asset", "logged_in_user", "client.put", "response.json"]
0
[]
The function (test_user_cannot_edit_asset_in_submission) defined within the public class called public.The function start at line 394 and ends at 404. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [394.0] and does not return any value. It declares 4.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
test_only_reviewer_can_approve_submission
def test_only_reviewer_can_approve_submission(publication, client):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)_register_user_in_db(REVIEWER)with logged_in_user(ALICE):response = client.post("/reviews",content=str(ReviewCreate(decision=Decision.ACCEPTED, submission_identifier=1, c...
1
24
2
192
2
407
433
407
publication,client
['identifier', 'response']
None
{"Assign": 4, "Expr": 1, "With": 2}
17
27
17
["register_asset", "_register_user_in_db", "logged_in_user", "client.post", "str", "json", "ReviewCreate", "response.json", "logged_in_user", "client.post", "str", "json", "ReviewCreate", "response.json", "client.get", "response.json", "response.json"]
0
[]
The function (test_only_reviewer_can_approve_submission) defined within the public class called public.The function start at line 407 and ends at 433. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [407.0] and does not return any value. It declares 17.0 funct...
aiondemand_AIOD-rest-api
public
public
0
0
test_reviewer_can_reject_submission
def test_reviewer_can_reject_submission(publication, client):identifier = register_asset(publication, owner=ALICE, status=EntryStatus.SUBMITTED)_register_user_in_db(REVIEWER)with logged_in_user(REVIEWER):response = client.post("/reviews",content=str(ReviewCreate(decision=Decision.REJECTED, submission_identifier=1, comm...
1
19
2
144
2
436
457
436
publication,client
['identifier', 'response']
None
{"Assign": 3, "Expr": 1, "With": 2}
12
22
12
["register_asset", "_register_user_in_db", "logged_in_user", "client.post", "str", "json", "ReviewCreate", "response.json", "logged_in_user", "client.get", "response.json", "response.json"]
0
[]
The function (test_reviewer_can_reject_submission) defined within the public class called public.The function start at line 436 and ends at 457. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [436.0] and does not return any value. It declares 12.0 functions, ...
aiondemand_AIOD-rest-api
public
public
0
0
test_reviewer_cannot_approve_own_submission
def test_reviewer_cannot_approve_own_submission(permission: PermissionType,publication_factory: Callable[[], Publication],client: TestClient):# Create an asset and add REVIEWER as a collaborator (write/admin)_register_user_in_db(REVIEWER)publication = publication_factory()register_asset(publication, owner=ALICE, status...
1
21
3
139
2
463
488
463
permission,publication_factory,client
['publication', 'response']
None
{"Assign": 2, "Expr": 5, "With": 2}
14
26
14
["_register_user_in_db", "publication_factory", "register_asset", "DbSession", "session.add", "set_permission", "session.commit", "logged_in_user", "client.post", "str", "json", "ReviewCreate", "response.json", "pytest.mark.parametrize"]
0
[]
The function (test_reviewer_cannot_approve_own_submission) defined within the public class called public.The function start at line 463 and ends at 488. It contains 21 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [463.0] and does not return any value. It declares 14.0 fun...
aiondemand_AIOD-rest-api
public
public
0
0
test_permission_type_order
def test_permission_type_order():permissions = {PermissionType.READ, PermissionType.WRITE, PermissionType.ADMIN}please_update_msg = "Test needs to be updated when PermissionTypes are added or removed."assert set(PermissionType) == permissions, please_update_msgassert PermissionType.ADMIN > PermissionType.WRITEassert Pe...
1
7
0
55
2
491
498
491
['permissions', 'please_update_msg']
None
{"Assign": 2}
1
8
1
["set"]
0
[]
The function (test_permission_type_order) defined within the public class called public.The function start at line 491 and ends at 498. 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 function, and It has 1.0 f...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_can_read
def test_user_can_read(owner, publication):identifier = register_asset(publication, owner=owner, status=EntryStatus.PUBLISHED)# `user_can_*` require object to be in session (or eagerly loaded)with DbSession() as session:asset = session.get(Publication, identifier)users = [ALICE, BOB, REVIEWER]assert all(user_can_read(u...
2
6
2
67
3
504
511
504
owner,publication
['users', 'asset', 'identifier']
None
{"Assign": 3, "With": 1}
6
8
6
["register_asset", "DbSession", "session.get", "all", "user_can_read", "pytest.mark.parametrize"]
0
[]
The function (test_user_can_read) defined within the public class called public.The function start at line 504 and ends at 511. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [504.0] and does not return any value. It declares 6.0 functions, and It has 6.0 fun...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_can_write
def test_user_can_write(owner, publication):identifier = register_asset(publication, owner=owner, status=EntryStatus.PUBLISHED)with DbSession() as session:asset = session.get(Publication, identifier)assert user_can_write(owner, asset.aiod_entry)others = [u for u in [ALICE, BOB, REVIEWER] if u != owner]assert not any(us...
4
7
2
85
3
517
524
517
owner,publication
['others', 'asset', 'identifier']
None
{"Assign": 3, "With": 1}
7
8
7
["register_asset", "DbSession", "session.get", "user_can_write", "any", "user_can_write", "pytest.mark.parametrize"]
0
[]
The function (test_user_can_write) defined within the public class called public.The function start at line 517 and ends at 524. It contains 7 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [517.0] and does not return any value. It declares 7.0 functions, and It has 7.0 fu...
aiondemand_AIOD-rest-api
public
public
0
0
test_user_can_administer
def test_user_can_administer(owner, publication):identifier = register_asset(publication, owner=owner, status=EntryStatus.PUBLISHED)with DbSession() as session:asset = session.get(Publication, identifier)assert user_can_administer(owner, asset.aiod_entry)others = [u for u in [ALICE, BOB, REVIEWER] if u != owner]assert ...
4
7
2
85
3
530
537
530
owner,publication
['others', 'asset', 'identifier']
None
{"Assign": 3, "With": 1}
7
8
7
["register_asset", "DbSession", "session.get", "user_can_administer", "any", "user_can_administer", "pytest.mark.parametrize"]
0
[]
The function (test_user_can_administer) defined within the public class called public.The function start at line 530 and ends at 537. It contains 7 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [530.0] and does not return any value. It declares 7.0 functions, and It has 7...
aiondemand_AIOD-rest-api
public
public
0
0
publication_body
def publication_body(body_asset: dict) -> dict:body = copy.deepcopy(body_asset)body["permanent_identifier"] = "http://dx.doi.org/10.1093/ajae/aaq063"body["isbn"] = "9783161484100"body["issn"] = "20493630"body["type"] = "journal"body["content"] = {"plain": "plain content"}return body
1
8
1
53
1
12
19
12
body_asset
['body']
dict
{"Assign": 6, "Return": 1}
2
8
2
["copy.deepcopy", "pytest.fixture"]
0
[]
The function (publication_body) defined within the public class called public.The function start at line 12 and ends at 19. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions c...
aiondemand_AIOD-rest-api
public
public
0
0
test_entry_status_does_not_update_on_put
def test_entry_status_does_not_update_on_put(client: TestClient,publication_body: dict,):with logged_in_user(ALICE):response = client.post("/publications", json=publication_body, headers={"Authorization": "Fake token"})assert response.status_code == 200, response.json()identifier = response.json()['identifier']# Defaul...
1
26
2
215
2
22
52
22
client,publication_body
['identifier', 'response']
None
{"Assign": 6, "With": 4}
15
31
15
["logged_in_user", "client.post", "response.json", "response.json", "logged_in_user", "client.get", "response.json", "response.json", "logged_in_user", "client.put", "response.json", "logged_in_user", "client.get", "response.json", "response.json"]
0
[]
The function (test_entry_status_does_not_update_on_put) defined within the public class called public.The function start at line 22 and ends at 52. It contains 26 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [22.0] and does not return any value. It declares 15.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
is_gnu_tar_installed
def is_gnu_tar_installed():try:result = subprocess.run(["tar", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)return "GNU tar" in result.stdoutexcept Exception:return False
2
8
0
45
1
17
24
17
['result']
Returns
{"Assign": 1, "Return": 2, "Try": 1}
1
8
1
["subprocess.run"]
0
[]
The function (is_gnu_tar_installed) defined within the public class called public.The function start at line 17 and ends at 24. It contains 8 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declare 1.0 function, and It has 1.0 funct...
aiondemand_AIOD-rest-api
public
public
0
0
create_test_files
def create_test_files(directory: Path, filenames: list):"""Create test files with simple content."""for name in filenames:path = directory / namewith open(path, "w") as f:f.write(f"Content of {name}\n")
2
5
2
39
1
34
39
34
directory,filenames
['path']
None
{"Assign": 1, "Expr": 2, "For": 1, "With": 1}
2
6
2
["open", "f.write"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.backups.test_backup_restore_py.test_backup_happy_path"]
The function (create_test_files) defined within the public class called public.The function start at line 34 and ends at 39. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [34.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions ca...
aiondemand_AIOD-rest-api
public
public
0
0
call_backup_command
def call_backup_command(command: list[str], env: dict) -> subprocess.CompletedProcess:return subprocess.run(command, env=env, check=True)
1
2
2
33
0
42
43
42
command,env
[]
subprocess.CompletedProcess
{"Return": 1}
1
2
1
["subprocess.run"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.backups.test_backup_restore_py.data_environment", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.backups.test_backup_restore_py....
The function (call_backup_command) defined within the public class called public.The function start at line 42 and ends at 43. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [42.0] and does not return any value. It declare 1.0 function, It has 1.0 function cal...
aiondemand_AIOD-rest-api
public
public
0
0
call_restore_command
def call_restore_command(command: list[str], env: dict) -> subprocess.CompletedProcess:return subprocess.run(command, env=env, input="y\n", text=True, check=True)
1
2
2
41
0
46
47
46
command,env
[]
subprocess.CompletedProcess
{"Return": 1}
1
2
1
["subprocess.run"]
1
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.backups.test_backup_restore_py.data_environment"]
The function (call_restore_command) defined within the public class called public.The function start at line 46 and ends at 47. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [46.0] and does not return any value. It declare 1.0 function, It has 1.0 function ca...
aiondemand_AIOD-rest-api
RestoreFunc
public
1
1
__call__
def __call__(self, level: int | None = None) -> subprocess.CompletedProcess:...
1
2
2
18
0
51
52
51
self,level
[]
subprocess.CompletedProcess
{"Expr": 1}
0
2
0
[]
59
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content...
The function (__call__) defined within the public class called RestoreFunc, implement an interface, and it inherit another class.The function start at line 51 and ends at 52. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [51.0] and does not return any value. ...
aiondemand_AIOD-rest-api
public
public
0
0
data_environment.backup
def backup() -> subprocess.CompletedProcess:return call_backup_command(backup_command, env)
1
2
0
15
0
95
96
95
null
[]
None
null
0
0
0
null
0
null
The function (data_environment.backup) defined within the public class called public.The function start at line 95 and ends at 96. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
data_environment.restore
def restore(level: int | None = None) -> subprocess.CompletedProcess:level_args = ["--level", str(level)] if level is not None else []return call_restore_command(restore_command + level_args, env)
2
3
1
42
0
98
100
98
null
[]
None
null
0
0
0
null
0
null
The function (data_environment.restore) defined within the public class called public.The function start at line 98 and ends at 100. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
data_environment
def data_environment(tmp_path) -> Iterator[DataEnvironment]:"""Sets up a temporary directory with files, and provides backup/restore commands.The directory structure created looks like:- temporary directory/- data/- original/- file1.txt (content: "Content of file1.txt\n")- file2.txt (content: "Content of file2.txt\n")-...
1
20
1
152
10
63
107
63
tmp_path
['data_name', 'restore_command', 'env', 'file1', 'backup_command', 'level_args', 'cycle_length', 'file_directory', 'file2', 'backup_dir']
Iterator[DataEnvironment]
{"Assign": 13, "Expr": 6, "Return": 2}
14
45
14
["str", "str", "str", "file_directory.mkdir", "backup_dir.mkdir", "os.environ.copy", "str", "str", "call_backup_command", "str", "call_restore_command", "file1.write_text", "file2.write_text", "DataEnvironment"]
0
[]
The function (data_environment) defined within the public class called public.The function start at line 63 and ends at 107. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 14.0 functions, and It has 14.0 functio...
aiondemand_AIOD-rest-api
public
public
0
0
test_backup_happy_path
def test_backup_happy_path():"""Test if the backup.sh script generates the correct directory structure.Usage: `bash backup.sh <data to backup:str> <cycle length:int>`"""with TemporaryDirectory() as tmpdir:cycle_length = 2data_name = "original"data_dir = tmpdir / Path("data")original_dir = tmpdir / Path("data") / data_n...
3
30
0
193
11
110
149
110
['data_name', 'env', 'backup_command', 'original_dir', 'cycle_length', 'backup_cycle_1_path', 'files_in_cycle_0', 'backup_dir', 'data_dir', 'backup_cycle_0_path', 'files_in_cycle_1']
None
{"Assign": 14, "Expr": 5, "For": 2, "With": 1}
14
40
14
["TemporaryDirectory", "Path", "Path", "Path", "os.environ.copy", "str", "str", "os.makedirs", "os.makedirs", "create_test_files", "str", "range", "call_backup_command", "backup_file.exists"]
0
[]
The function (test_backup_happy_path) defined within the public class called public.The function start at line 110 and ends at 149. It contains 30 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 14.0 functions, and It has 14.0 ...
aiondemand_AIOD-rest-api
public
public
0
0
test_restore_happy_path
def test_restore_happy_path(data_environment: DataEnvironment):"""Test if the restore.sh script restores the files properly.Usage:`bash restore.sh <data to restore:str> <cycle label:int> [--level|-l <level:int>]`"""backup, restore, file1, file2 = data_environmentassert file1.read_text() == "Content of file1.txt\n"asser...
1
20
1
140
1
152
182
152
data_environment
['microsecond']
None
{"Assign": 2, "Expr": 10}
17
31
17
["file1.read_text", "file2.read_text", "backup", "file1.unlink", "file2.write_text", "time.sleep", "backup", "time.sleep", "restore", "file1.exists", "file2.exists", "file2.read_text", "restore", "file1.exists", "file2.exists", "restore", "file1.exists"]
0
[]
The function (test_restore_happy_path) defined within the public class called public.The function start at line 152 and ends at 182. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 17.0 functions, and It has 17.0...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_happy_path
def test_fetch_happy_path():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "catalog_solutions.json")solution_1_path = os.path.join(test_resources_path, "solution_1.json")solution_2_path = os.path.join(test_resources_path, "solution_2....
2
32
0
334
6
28
60
28
['fetched_resources', 'solution_2_path', 'catalog_solutions_path', 'response', 'solution_1_path', 'catalog_list_path']
None
{"Assign": 10, "Expr": 4, "For": 1, "With": 5}
25
33
25
["os.path.join", "os.path.join", "os.path.join", "os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "enumerate", "type"...
0
[]
The function (test_fetch_happy_path) defined within the public class called public.The function start at line 28 and ends at 60. It contains 32 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 25.0 functions, and It has 25.0 fun...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_happy_path_unaware_datetime
def test_fetch_happy_path_unaware_datetime():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "catalog_solutions.json")solution_1_path = os.path.join(test_resources_path, "solution_1.json")solution_2_path = os.path.join(test_resources_p...
2
36
0
350
8
63
99
63
['fetched_resources', 'mocked_unaware_datetime_to', 'solution_2_path', 'catalog_solutions_path', 'mocked_unaware_datetime_from', 'response', 'solution_1_path', 'catalog_list_path']
None
{"Assign": 12, "Expr": 4, "For": 1, "With": 5}
27
37
27
["os.path.join", "os.path.join", "os.path.join", "os.path.join", "datetime.fromisoformat", "datetime.fromisoformat", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "...
0
[]
The function (test_fetch_happy_path_unaware_datetime) defined within the public class called public.The function start at line 63 and ends at 99. It contains 36 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 27.0 functions, and...
aiondemand_AIOD-rest-api
public
public
0
0
test_unautorized_token_error
def test_unautorized_token_error():error = {"error": {"message": "Unauthorized token."}}err_msg = f"Error while fetching {catalog_list_url} from AIBuilder: (401) Unauthorized token."fetched_resources = []with responses.RequestsMock() as mocked_requests:mocked_requests.add(responses.GET, catalog_list_url, json=error, st...
1
15
0
117
3
102
117
102
['err_msg', 'fetched_resources', 'error']
None
{"Assign": 5, "Expr": 1, "With": 1}
8
16
8
["responses.RequestsMock", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "str"]
0
[]
The function (test_unautorized_token_error) defined within the public class called public.The function start at line 102 and ends at 117. 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 8.0 functions, and It has ...
aiondemand_AIOD-rest-api
public
public
0
0
test_catalog_list_http_error
def test_catalog_list_http_error():error = {"error": {"message": "HTTP Error."}}err_msg = f"Error while fetching {catalog_list_url} from AIBuilder: (500) Internal Server Error"fetched_resources = []with responses.RequestsMock() as mocked_requests:mocked_requests.add(responses.GET, catalog_list_url, json=error, status=5...
1
15
0
117
3
120
135
120
['err_msg', 'fetched_resources', 'error']
None
{"Assign": 5, "Expr": 1, "With": 1}
8
16
8
["responses.RequestsMock", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "str"]
0
[]
The function (test_catalog_list_http_error) defined within the public class called public.The function start at line 120 and ends at 135. 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 8.0 functions, and It has ...
aiondemand_AIOD-rest-api
public
public
0
0
test_catalog_list_format_error
def test_catalog_list_format_error():catalog_list_path = os.path.join(test_resources_path, "catalog_list_format_error.json")fetched_resources = []with responses.RequestsMock() as mocked_requests:with open(catalog_list_path, "r") as f:response = json.load(f)mocked_requests.add(responses.GET, catalog_list_url, json=respo...
1
16
0
132
3
138
154
138
['fetched_resources', 'catalog_list_path', 'response']
None
{"Assign": 5, "Expr": 1, "With": 2}
11
17
11
["os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "str"]
0
[]
The function (test_catalog_list_format_error) defined within the public class called public.The function start at line 138 and ends at 154. It contains 16 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 11.0 functions, and It h...
aiondemand_AIOD-rest-api
public
public
0
0
test_empty_catalog_list
def test_empty_catalog_list():catalog_list_path = os.path.join(test_resources_path, "empty_catalog_list.json")fetched_resources = []with responses.RequestsMock() as mocked_requests:with open(catalog_list_path, "r") as f:response = json.load(f)mocked_requests.add(responses.GET, catalog_list_url, json=response, status=20...
1
15
0
120
3
157
172
157
['fetched_resources', 'catalog_list_path', 'response']
None
{"Assign": 5, "Expr": 1, "With": 2}
9
16
9
["os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type"]
0
[]
The function (test_empty_catalog_list) defined within the public class called public.The function start at line 157 and ends at 172. 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 9.0 functions, and It has 9.0 f...
aiondemand_AIOD-rest-api
public
public
0
0
test_catalog_solutions_http_error
def test_catalog_solutions_http_error():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")error = {"error": {"message": "HTTP Error."}}err_msg = (f"Error while fetching {catalog_solutions_url} from AIBuilder: (500) Internal Server Error")fetched_resources = []with responses.RequestsMock() as moc...
1
20
0
163
5
175
195
175
['fetched_resources', 'response', 'err_msg', 'catalog_list_path', 'error']
None
{"Assign": 7, "Expr": 2, "With": 2}
12
21
12
["os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "str"]
0
[]
The function (test_catalog_solutions_http_error) defined within the public class called public.The function start at line 175 and ends at 195. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 12.0 functions, and I...
aiondemand_AIOD-rest-api
public
public
0
0
test_catalog_solutions_format_error
def test_catalog_solutions_format_error():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "catalog_solutions_format_error.json")fetched_resources = []with responses.RequestsMock() as mocked_requests:with open(catalog_list_path, "r") as...
1
21
0
176
4
198
219
198
['fetched_resources', 'response', 'catalog_list_path', 'catalog_solutions_path']
None
{"Assign": 7, "Expr": 2, "With": 3}
15
22
15
["os.path.join", "os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "str"]
0
[]
The function (test_catalog_solutions_format_error) defined within the public class called public.The function start at line 198 and ends at 219. It contains 21 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 15.0 functions, and ...
aiondemand_AIOD-rest-api
public
public
0
0
test_empty_catalog_solutions
def test_empty_catalog_solutions():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "empty_catalog_solutions.json")fetched_resources = []with responses.RequestsMock() as mocked_requests:with open(catalog_list_path, "r") as f:response = ...
1
18
0
164
4
222
240
222
['fetched_resources', 'response', 'catalog_list_path', 'catalog_solutions_path']
None
{"Assign": 7, "Expr": 2, "With": 3}
13
19
13
["os.path.join", "os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type"]
0
[]
The function (test_empty_catalog_solutions) defined within the public class called public.The function start at line 222 and ends at 240. 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 13.0 functions, and It has...
aiondemand_AIOD-rest-api
public
public
0
0
test_solution_http_error
def test_solution_http_error():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "catalog_solutions.json")error = {"error": {"message": "HTTP Error."}}err_msg = f"Error while fetching {solution_1_url} from AIBuilder: (500) Internal Serve...
1
37
0
348
7
243
280
243
['fetched_resources', 'solution_2_path', 'catalog_solutions_path', 'response', 'err_msg', 'catalog_list_path', 'error']
None
{"Assign": 12, "Expr": 4, "With": 4}
23
38
23
["os.path.join", "os.path.join", "os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "str", "type", "Text", "set"]
0
[]
The function (test_solution_http_error) defined within the public class called public.The function start at line 243 and ends at 280. It contains 37 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 23.0 functions, and It has 23....
aiondemand_AIOD-rest-api
public
public
0
0
test_solution_format_error
def test_solution_format_error():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "catalog_solutions.json")solution_1_path = os.path.join(test_resources_path, "solution_1_format_error.json")solution_2_path = os.path.join(test_resources_...
1
37
0
351
6
283
320
283
['fetched_resources', 'solution_2_path', 'catalog_solutions_path', 'response', 'solution_1_path', 'catalog_list_path']
None
{"Assign": 12, "Expr": 4, "With": 5}
24
38
24
["os.path.join", "os.path.join", "os.path.join", "os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "Te...
0
[]
The function (test_solution_format_error) defined within the public class called public.The function start at line 283 and ends at 320. It contains 37 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 24.0 functions, and It has 2...
aiondemand_AIOD-rest-api
public
public
0
0
test_solution_last_modified_exception
def test_solution_last_modified_exception():catalog_list_path = os.path.join(test_resources_path, "catalog_list.json")catalog_solutions_path = os.path.join(test_resources_path, "catalog_solutions.json")solution_1_path = os.path.join(test_resources_path, "solution_1_last_modified_exception.json")solution_2_path = os.pat...
1
38
0
363
6
323
361
323
['fetched_resources', 'solution_2_path', 'catalog_solutions_path', 'response', 'solution_1_path', 'catalog_list_path']
None
{"Assign": 12, "Expr": 4, "With": 5}
26
39
26
["os.path.join", "os.path.join", "os.path.join", "os.path.join", "responses.RequestsMock", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "open", "json.load", "mocked_requests.add", "list", "connector.fetch", "len", "type", "type", "st...
0
[]
The function (test_solution_last_modified_exception) defined within the public class called public.The function start at line 323 and ends at 361. It contains 38 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 26.0 functions, an...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_happy_path
def test_fetch_happy_path(datatype: str):connector = example_connectors[datatype]resources = list(connector.fetch())assert len(resources) >= 1resource = resources[0]if hasattr(resource, "keywords"):# otherwise, only tested that connector can runassert set(resource.keywords) == {"keyword1", "keyword2"}
2
7
1
57
3
41
47
41
datatype
['resources', 'connector', 'resource']
None
{"Assign": 3, "If": 1}
6
7
6
["list", "connector.fetch", "len", "hasattr", "set", "pytest.mark.parametrize"]
0
[]
The function (test_fetch_happy_path) defined within the public class called public.The function start at line 41 and ends at 47. 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 6.0 functions, and It has 6.0 functi...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_all_happy_path
def test_fetch_all_happy_path():names_expected = {"0n1xus/codexglue","04-07-22/wep-probes","rotten_tomatoes","acronym_identification","air_dialogue","bobbydylan/top2k",}ids_expected = {"621ffdd236468d709f18203a","62cd5fa83e5ba89c40f22b0d","621ffdd236468d709f181f5f","621ffdd236468d709f181d58","621ffdd236468d709f181d5f",...
11
74
0
377
9
14
91
14
['ids_expected', 'resources_with_relations', 'path_data_list', 'names_expected', 'datasets', 'expected_url_base', 'dataset', 'response', 'connector']
None
{"Assign": 9, "Expr": 2, "For": 1, "With": 2}
22
78
22
["HuggingFaceDatasetConnector", "responses.RequestsMock", "path_test_resources", "open", "json.load", "mocked_requests.add", "mock_parquet", "list", "connector.fetch", "len", "len", "all", "type", "all", "all", "all", "len", "all", "len", "Text", "len", "set"]
0
[]
The function (test_fetch_all_happy_path) defined within the public class called public.The function start at line 14 and ends at 91. It contains 74 lines of code and it has a cyclomatic complexity of 11. The function does not take any parameters and does not return any value. It declares 22.0 functions, and It has 22....
aiondemand_AIOD-rest-api
public
public
0
0
test_incorrect_citation
def test_incorrect_citation():"""Many datasets have an incorrect citation, missing the closing '}'.Example:@article{haouari2020arcov19,title={ArCOV-19: The First Arabic COVID-19 Twitter Dataset with Propagation Networks},author={Fatima Haouari and Maram Hasanain and Reem Suwaileh and Tamer Elsayed},journal={arXiv prepr...
3
33
0
150
5
94
139
94
['ids_expected', 'resources_with_relations', 'path_data_list', 'response', 'connector']
None
{"Assign": 7, "Expr": 3, "For": 1, "With": 2}
9
46
9
["HuggingFaceDatasetConnector", "responses.RequestsMock", "path_test_resources", "open", "json.load", "mocked_requests.add", "mock_parquet", "list", "connector.fetch"]
0
[]
The function (test_incorrect_citation) defined within the public class called public.The function start at line 94 and ends at 139. It contains 33 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 9.0 functions, and It has 9.0 fu...
aiondemand_AIOD-rest-api
public
public
0
0
mock_parquet
def mock_parquet(mocked_requests: responses.RequestsMock, dataset_name: str):filename = f"parquet_{dataset_name.replace('/', '_')}.json"path_split = path_test_resources() / "connectors" / "huggingface" / filenamewith open(path_split, "r") as f:response = json.load(f)status = 200 if "error" not in response else 404mocke...
2
12
2
76
4
142
153
142
mocked_requests,dataset_name
['path_split', 'filename', 'status', 'response']
None
{"Assign": 4, "Expr": 1, "With": 1}
5
12
5
["dataset_name.replace", "path_test_resources", "open", "json.load", "mocked_requests.add"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.huggingface.test_huggingface_dataset_connector_py.test_fetch_all_happy_path", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.sr...
The function (mock_parquet) defined within the public class called public.The function start at line 142 and ends at 153. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [142.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions cal...
aiondemand_AIOD-rest-api
public
public
0
0
test_first_run
def test_first_run():state = {}connector = OpenMlDatasetConnector(limit_per_iteration=2)with responses.RequestsMock() as mocked_requests:for offset in (0, 2):mock_list_data(mocked_requests, offset)for i in range(2, 5):mock_get_data(mocked_requests, str(i))datasets = list(connector.run(state, from_identifier=0, limit=No...
5
13
0
129
3
10
24
10
['state', 'datasets', 'connector']
None
{"Assign": 3, "Expr": 2, "For": 2, "With": 1}
10
15
10
["OpenMlDatasetConnector", "responses.RequestsMock", "mock_list_data", "range", "mock_get_data", "str", "list", "connector.run", "len", "len"]
0
[]
The function (test_first_run) defined within the public class called public.The function start at line 10 and ends at 24. It contains 13 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It has 10.0 functions ...
aiondemand_AIOD-rest-api
public
public
0
0
test_request_empty_list
def test_request_empty_list():"""Tests if the state doesn't change after a request when OpenML returns an empty list."""state = {"last_id": 3}connector = OpenMlDatasetConnector(limit_per_iteration=2)with responses.RequestsMock() as mocked_requests:mocked_requests.add(responses.GET,f"{OPENML_URL}/data/list/limit/2/offse...
1
14
0
114
3
27
42
27
['state', 'datasets', 'connector']
None
{"Assign": 3, "Expr": 2, "With": 1}
6
16
6
["OpenMlDatasetConnector", "responses.RequestsMock", "mocked_requests.add", "list", "connector.run", "len"]
0
[]
The function (test_request_empty_list) defined within the public class called public.The function start at line 27 and ends at 42. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 fun...
aiondemand_AIOD-rest-api
public
public
0
0
test_second_run
def test_second_run():connector = OpenMlDatasetConnector(limit_per_iteration=2)state = {"last_id": 3}# state from last runwith responses.RequestsMock() as mocked_requests:mock_list_data(mocked_requests, offset=0)# Mock the first call to fetch datasets with offset=0mock_list_data(mocked_requests, offset=2)# Mock the sec...
2
16
0
110
3
45
62
45
['state', 'datasets', 'connector']
None
{"Assign": 3, "Expr": 3, "With": 1}
8
18
8
["OpenMlDatasetConnector", "responses.RequestsMock", "mock_list_data", "mock_list_data", "mock_get_data", "list", "connector.run", "len"]
0
[]
The function (test_second_run) defined within the public class called public.The function start at line 45 and ends at 62. It contains 16 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 functions c...
aiondemand_AIOD-rest-api
public
public
0
0
mock_list_data
def mock_list_data(mocked_requests, offset):"""Mocking requests to the OpenML dependency, so that we test only our own services"""with open(path_test_resources() / "connectors" / "openml" / f"list_offset_{offset}.json","r",) as f:data_response = json.load(f)mocked_requests.add(responses.GET,f"{OPENML_URL}/data/list/lim...
1
12
2
56
1
65
80
65
mocked_requests,offset
['data_response']
None
{"Assign": 1, "Expr": 2, "With": 1}
4
16
4
["open", "path_test_resources", "json.load", "mocked_requests.add"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.openml.test_openml_dataset_connector_py.test_first_run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.op...
The function (mock_list_data) defined within the public class called public.The function start at line 65 and ends at 80. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [65.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
mock_get_data
def mock_get_data(mocked_requests: responses.RequestsMock, platform_resource_identifier: str):"""Mocking requests to the OpenML dependency, so that we test only our own services"""with open(path_test_resources()/ "connectors"/ "openml"/ f"data_{platform_resource_identifier}.json","r",) as f:data_response = json.load(f)...
1
15
2
62
1
83
101
83
mocked_requests,platform_resource_identifier
['data_response']
None
{"Assign": 1, "Expr": 2, "With": 1}
4
19
4
["open", "path_test_resources", "json.load", "mocked_requests.add"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.openml.test_openml_dataset_connector_py.test_first_run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.op...
The function (mock_get_data) defined within the public class called public.The function start at line 83 and ends at 101. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [83.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
mock_get_qualities
def mock_get_qualities(mocked_requests: responses.RequestsMock, platform_resource_identifier: str):"""Mocking requests to the OpenML dependency, so that we test only our own services"""with open(path_test_resources()/ "connectors"/ "openml"/ f"data_{platform_resource_identifier}.json","r",) as f:data_response = json.lo...
1
29
2
110
2
104
137
104
mocked_requests,platform_resource_identifier
['data_response', 'data_qualities_response']
None
{"Assign": 2, "Expr": 3, "With": 2}
8
34
8
["open", "path_test_resources", "json.load", "open", "path_test_resources", "json.load", "mocked_requests.add", "mocked_requests.add"]
0
[]
The function (mock_get_qualities) defined within the public class called public.The function start at line 104 and ends at 137. It contains 29 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [104.0] and does not return any value. It declares 8.0 functions, and It has 8.0 fu...
aiondemand_AIOD-rest-api
public
public
0
0
test_first_run
def test_first_run():state = {}connector = OpenMlMLModelConnector(limit_per_iteration=2)with responses.RequestsMock() as mocked_requests:for offset in (0, 2):mock_list_data(mocked_requests, offset)for i in range(1, 4):mock_get_data(mocked_requests, str(i))mlmodels = list(connector.run(state, from_identifier=0, limit=No...
5
19
0
136
3
11
30
11
['mlmodels', 'state', 'connector']
None
{"Assign": 3, "Expr": 2, "For": 2, "With": 1}
10
20
10
["OpenMlMLModelConnector", "responses.RequestsMock", "mock_list_data", "range", "mock_get_data", "str", "list", "connector.run", "len", "len"]
0
[]
The function (test_first_run) defined within the public class called public.The function start at line 11 and ends at 30. It contains 19 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It has 10.0 functions ...
aiondemand_AIOD-rest-api
public
public
0
0
test_request_empty_list
def test_request_empty_list():"""Tests if the state doesn't change after a request when OpenML returns an empty list."""state = {"last_id": 3}connector = OpenMlMLModelConnector(limit_per_iteration=2)with responses.RequestsMock() as mocked_requests:mocked_requests.add(responses.GET,f"{OPENML_URL}/flow/list/limit/2/offse...
1
14
0
114
3
33
48
33
['state', 'connector', 'ml_models']
None
{"Assign": 3, "Expr": 2, "With": 1}
6
16
6
["OpenMlMLModelConnector", "responses.RequestsMock", "mocked_requests.add", "list", "connector.run", "len"]
0
[]
The function (test_request_empty_list) defined within the public class called public.The function start at line 33 and ends at 48. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 fun...
aiondemand_AIOD-rest-api
public
public
0
0
test_second_run
def test_second_run():connector = OpenMlMLModelConnector(limit_per_iteration=2)state = {"last_id": 2, "from_id": 0}with responses.RequestsMock() as mocked_requests:mock_list_data(mocked_requests, offset=0)mock_list_data(mocked_requests, offset=2)mock_get_data(mocked_requests, "3")mlmodels = list(connector.run(state=sta...
2
22
0
226
4
51
74
51
['mlmodel', 'mlmodels', 'state', 'connector']
None
{"Assign": 4, "Expr": 3, "With": 1}
11
24
11
["OpenMlMLModelConnector", "responses.RequestsMock", "mock_list_data", "mock_list_data", "mock_get_data", "list", "connector.run", "len", "len", "datetime.datetime", "len"]
0
[]
The function (test_second_run) defined within the public class called public.The function start at line 51 and ends at 74. It contains 22 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 11.0 functions, and It has 11.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
mock_list_data
def mock_list_data(mocked_requests, offset):"""Mocking requests to the OpenML dependency, so that we test only our own services"""with open(path_test_resources() / "connectors" / "openml" / f"mlmodel_list_offset_{offset}.json","r",) as f:mlmodel_response = json.load(f)mocked_requests.add(responses.GET,f"{OPENML_URL}/fl...
1
12
2
56
1
77
91
77
mocked_requests,offset
['mlmodel_response']
None
{"Assign": 1, "Expr": 2, "With": 1}
4
15
4
["open", "path_test_resources", "json.load", "mocked_requests.add"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.openml.test_openml_dataset_connector_py.test_first_run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.op...
The function (mock_list_data) defined within the public class called public.The function start at line 77 and ends at 91. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [77.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
mock_get_data
def mock_get_data(mocked_requests: responses.RequestsMock, platform_resource_identifier: str):"""Mocking requests to the OpenML dependency, so that we test only our own services"""with open(path_test_resources()/ "connectors"/ "openml"/ f"mlmodel_{platform_resource_identifier}.json","r",) as f:mlmodel_response = json.l...
1
15
2
62
1
94
112
94
mocked_requests,platform_resource_identifier
['mlmodel_response']
None
{"Assign": 1, "Expr": 2, "With": 1}
4
19
4
["open", "path_test_resources", "json.load", "mocked_requests.add"]
4
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.openml.test_openml_dataset_connector_py.test_first_run", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.op...
The function (mock_get_data) defined within the public class called public.The function start at line 94 and ends at 112. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [94.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
first_list_response
def first_list_response(mocked_requests: responses.RequestsMock):mocked_requests.add(responses.GET,"https://zenodo.org/oai2d?""metadataPrefix=oai_datacite&""from=2023-05-23T08%3A00%3A00&""until=2023-05-23T09%3A00%3A00&""verb=ListRecords",body=records_list_1,status=200,)
1
11
1
32
0
15
25
15
mocked_requests
[]
None
{"Expr": 1}
1
11
1
["mocked_requests.add"]
0
[]
The function (first_list_response) defined within the public class called public.The function start at line 15 and ends at 25. 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 declare 1.0 function, and It has 1.0 function ...
aiondemand_AIOD-rest-api
public
public
0
0
second_list_response
def second_list_response(mocked_requests: responses.RequestsMock):mocked_requests.add(responses.GET,"https://zenodo.org/oai2d?""resumptionToken=.resumption-token-to-page-2&""verb=ListRecords",body=records_list_2,status=200,)
1
9
1
30
0
28
36
28
mocked_requests
[]
None
{"Expr": 1}
1
9
1
["mocked_requests.add"]
0
[]
The function (second_list_response) defined within the public class called public.The function start at line 28 and ends at 36. 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 declare 1.0 function, and It has 1.0 function ...
aiondemand_AIOD-rest-api
public
public
0
0
second_list_response_after_interruption
def second_list_response_after_interruption(mocked_requests: responses.RequestsMock):mocked_requests.add(responses.GET,"https://zenodo.org/oai2d?""metadataPrefix=oai_datacite&""from=2023-05-23T08%3A00%3A47.001000&""until=2023-05-23T09%3A00%3A00&""verb=ListRecords",body=records_list_2,status=200,)
1
11
1
32
0
39
49
39
mocked_requests
[]
None
{"Expr": 1}
1
11
1
["mocked_requests.add"]
0
[]
The function (second_list_response_after_interruption) defined within the public class called public.The function start at line 39 and ends at 49. 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 declare 1.0 function, and ...
aiondemand_AIOD-rest-api
public
public
0
0
second_list_response_time_out
def second_list_response_time_out(mocked_requests: responses.RequestsMock):mocked_requests.add(responses.GET,"https://zenodo.org/oai2d?""resumptionToken=.resumption-token-to-page-2&""verb=ListRecords",body=("<html><body><h1>504 Gateway Time-out</h1>\n""The server didn't respond in time.\n</body></html>\n"),status=504,)
1
12
1
33
0
52
63
52
mocked_requests
[]
None
{"Expr": 1}
1
12
1
["mocked_requests.add"]
0
[]
The function (second_list_response_time_out) defined within the public class called public.The function start at line 52 and ends at 63. 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 declare 1.0 function, and It has 1.0...
aiondemand_AIOD-rest-api
public
public
0
0
response_with_no_records
def response_with_no_records(mocked_requests: responses.RequestsMock):mocked_requests.add(responses.GET,"https://zenodo.org/oai2d?""metadataPrefix=oai_datacite&""from=2023-05-23T08%3A00%3A00&""until=2023-05-23T09%3A00%3A00&""verb=ListRecords",body="422 Client Error: UNPROCESSABLE ENTITY",status=422,)
1
11
1
32
0
66
76
66
mocked_requests
[]
None
{"Expr": 1}
1
11
1
["mocked_requests.add"]
0
[]
The function (response_with_no_records) defined within the public class called public.The function start at line 66 and ends at 76. 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 declare 1.0 function, and It has 1.0 func...
aiondemand_AIOD-rest-api
public
public
0
0
record_response
def record_response(mocked_requests: responses.RequestsMock, id_: int):with open(path_test_resources() / "connectors" / "zenodo" / f"{id_}.json", "r") as f:body = f.read()mocked_requests.add(responses.GET, f"https://zenodo.org/api/records/{id_}/files", body=body, status=200)
1
6
2
58
1
79
84
79
mocked_requests,id_
['body']
None
{"Assign": 1, "Expr": 1, "With": 1}
4
6
4
["open", "path_test_resources", "f.read", "mocked_requests.add"]
2
["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.zenodo.mock_zenodo_py.first_list_records_responses", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95056621_aiondemand_AIOD_rest_api.src.tests.connectors.zenodo...
The function (record_response) defined within the public class called public.The function start at line 79 and ends at 84. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [79.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions call...
aiondemand_AIOD-rest-api
public
public
0
0
first_list_records_responses
def first_list_records_responses(mocked_requests: responses.RequestsMock):for id_ in (6884943, 7793917, 7947283, 7555467, 7902673):record_response(mocked_requests, id_)
2
3
1
30
0
87
89
87
mocked_requests
[]
None
{"Expr": 1, "For": 1}
1
3
1
["record_response"]
0
[]
The function (first_list_records_responses) defined within the public class called public.The function start at line 87 and ends at 89. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 f...
aiondemand_AIOD-rest-api
public
public
0
0
second_list_records_responses
def second_list_records_responses(mocked_requests: responses.RequestsMock):record_response(mocked_requests, 7199024)
1
2
1
15
0
92
93
92
mocked_requests
[]
None
{"Expr": 1}
1
2
1
["record_response"]
0
[]
The function (second_list_records_responses) defined within the public class called public.The function start at line 92 and ends at 93. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 ...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_happy_path
def test_fetch_happy_path():"""Test the successful path scenario for fetching records from Zenodo.This test ensures that all 51 records are fetched correctly and processed as expected(6 datasets without errors and the rest due to 'wrong type).Steps:1. Mock responses for list and record requests.2. Initialize the connec...
8
48
0
361
10
26
86
26
['distributions', 'datasets', 'errors', 'expected', 'dataset', 'from_incl', 'to_excl', 'resources', 'connector', 'distribution']
None
{"AnnAssign": 1, "Assign": 11, "Expr": 5, "With": 1}
23
61
23
["ZenodoDatasetConnector", "responses.RequestsMock", "mock_zenodo.first_list_response", "mock_zenodo.first_list_records_responses", "mock_zenodo.second_list_response", "mock_zenodo.second_list_records_responses", "datetime.datetime", "datetime.datetime", "list", "connector.run", "isinstance", "isinstance", "len", "len"...
0
[]
The function (test_fetch_happy_path) defined within the public class called public.The function start at line 26 and ends at 86. It contains 48 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 declares 23.0 functions, and It has 23.0 fun...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_expired_token_happy_path
def test_fetch_expired_token_happy_path():"""Test the scenario when the resumption token expires during fetching.This test ensures that the connector stops the calls before that happens avoiding a 422 error.Then it resumes the process fetching the next batch of records with a new resumption token.As a result all the re...
6
16
0
163
7
89
117
89
['datasets', 'errors', 'state', 'from_incl', 'to_excl', 'resources', 'connector']
None
{"Assign": 7, "Expr": 5, "With": 1}
14
29
14
["ZenodoDatasetConnector", "responses.RequestsMock", "mock_zenodo.first_list_response", "mock_zenodo.second_list_response_after_interruption", "mock_zenodo.first_list_records_responses", "mock_zenodo.second_list_records_responses", "datetime.datetime", "datetime.datetime", "list", "connector.run", "isinstance", "isinst...
0
[]
The function (test_fetch_expired_token_happy_path) defined within the public class called public.The function start at line 89 and ends at 117. It contains 16 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 14.0 functions, and ...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_harvesting_rate_limit.mock_check
def mock_check():pass
1
2
0
5
0
137
138
137
null
[]
None
null
0
0
0
null
0
null
The function (test_fetch_harvesting_rate_limit.mock_check) defined within the public class called public.The function start at line 137 and ends at 138. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_harvesting_rate_limit
def test_fetch_harvesting_rate_limit(monkeypatch):"""Test the scenario when the harvesting rate limit is reached.This test ensures that the connector handles rate limits correctly.With harvest rate limit set to 1, the API will fail to retrieve the second list.In reality the tested method will sleep and retry resuming t...
1
14
1
138
4
121
151
121
monkeypatch
['to_excl', 'resources', 'connector', 'from_incl']
None
{"Assign": 4, "Expr": 3, "With": 2}
11
31
11
["limits", "monkeypatch.setattr", "responses.RequestsMock", "mock_zenodo.first_list_response", "datetime.datetime", "datetime.datetime", "zenodo_dataset_connector.ZenodoDatasetConnector", "pytest.raises", "list", "connector.run", "freeze_time"]
0
[]
The function (test_fetch_harvesting_rate_limit) defined within the public class called public.The function start at line 121 and ends at 151. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 11.0 functions, and It...
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_records_rate_limit.mock_check
def mock_check(id_number):response = requests.get(f"https://zenodo.org/api/records/{id_number}/files", timeout=REQUEST_TIMEOUT)return response
1
5
1
20
0
171
175
171
null
[]
None
null
0
0
0
null
0
null
The function (test_fetch_records_rate_limit.mock_check) defined within the public class called public.The function start at line 171 and ends at 175. 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..
aiondemand_AIOD-rest-api
public
public
0
0
test_fetch_records_rate_limit
def test_fetch_records_rate_limit(monkeypatch):"""Cheap check to test the scenario when the rate limit for fetching records is reached.This test ensures that the connector handles record fetch rate limits correctly.With rate limit set to 1, only the first record will be retrieved. In realitythe tested method will sleep...
6
18
1
191
7
155
194
155
monkeypatch
['datasets', 'errors', 'from_incl', 'to_excl', 'resources', 'connector', 'response']
Returns
{"Assign": 7, "Expr": 5, "Return": 1, "With": 1}
18
40
18
["requests.get", "limits", "monkeypatch.setattr", "responses.RequestsMock", "mock_zenodo.first_list_response", "mock_zenodo.second_list_response", "mock_zenodo.record_response", "datetime.datetime", "datetime.datetime", "zenodo_dataset_connector.ZenodoDatasetConnector", "list", "connector.run", "isinstance", "isinstanc...
0
[]
The function (test_fetch_records_rate_limit) defined within the public class called public.The function start at line 155 and ends at 194. It contains 18 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters, and this function return a value. It declares 18.0 functions, and I...
aiondemand_AIOD-rest-api
public
public
0
0
test_resuming_processing_after_timeout
def test_resuming_processing_after_timeout():"""Test the scenario when the fetching the records is interrupted by time out errorfrom zenodo. It's expected that the API halts fetching the records and starts processing themto avoid losing the records already retrieved.Steps:1. Mock responses for list and record requests....
6
16
0
168
6
198
224
198
['datasets', 'errors', 'from_incl', 'to_excl', 'resources', 'connector']
None
{"Assign": 6, "Expr": 6, "With": 1}
16
27
16
["ZenodoDatasetConnector", "responses.RequestsMock", "mock_zenodo.first_list_response", "mock_zenodo.second_list_response_time_out", "mock_zenodo.first_list_records_responses", "mock_zenodo.second_list_response_after_interruption", "mock_zenodo.second_list_records_responses", "datetime.datetime", "datetime.datetime", "...
0
[]
The function (test_resuming_processing_after_timeout) defined within the public class called public.The function start at line 198 and ends at 224. It contains 16 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 16.0 functions, a...
aiondemand_AIOD-rest-api
public
public
0
0
test_response_with_no_records
def test_response_with_no_records():"""Test the scenario when the fetching the records returns an 422 error in the first call,which means that no record was found for the chosen period.Steps:1. Mock responses for list and record requests.2. Initialize the connector and fetch records within a specified time range.3. Val...
5
17
0
192
7
228
254
228
['datasets', 'errors', 'state', 'from_incl', 'to_excl', 'resources', 'connector']
None
{"Assign": 7, "Expr": 2, "With": 1}
15
27
15
["ZenodoDatasetConnector", "responses.RequestsMock", "mock_zenodo.response_with_no_records", "datetime.datetime", "datetime.datetime", "list", "connector.run", "isinstance", "isinstance", "len", "len", "isinstance", "from_incl.timestamp", "to_excl.timestamp", "freeze_time"]
0
[]
The function (test_response_with_no_records) defined within the public class called public.The function start at line 228 and ends at 254. It contains 17 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 15.0 functions, and It ha...
aiondemand_AIOD-rest-api
public
public
0
0
test_aiod_to_dcatap_happy_path
def test_aiod_to_dcatap_happy_path(dataset: Dataset):dataset.identifier = "data_"dataset.license = License(name="a license")dataset.alternate_name = [AlternateName(name="alias1"), AlternateName(name="alias2")]dataset.size = DatasetSizeORM(value=1, unit="Rows")dataset.keyword = [AlternateName(name="keyword1"), Alternate...
2
21
1
260
5
14
37
14
dataset
['converter', 'expected', 'dcat_ap', 'actual', 'creator']
None
{"Assign": 15, "For": 1, "With": 2}
20
24
20
["License", "AlternateName", "AlternateName", "DatasetSizeORM", "AlternateName", "AlternateName", "Person", "Publication", "datetime.datetime", "datetime.datetime", "DbSession", "converter.convert", "dcat_ap.json", "open", "path_test_resources", "f.read", "enumerate", "zip", "actual.split", "expected.split"]
0
[]
The function (test_aiod_to_dcatap_happy_path) defined within the public class called public.The function start at line 14 and ends at 37. It contains 21 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 20.0 functions, and It has...
aiondemand_AIOD-rest-api
public
public
0
0
test_aiod_to_schema_dot_org_happy_path
def test_aiod_to_schema_dot_org_happy_path(dataset: Dataset):dataset.identifier = "data_identifier"dataset.license = License(name="a license")dataset.alternate_name = [AlternateName(name="alias1"), AlternateName(name="alias2")]dataset.size = DatasetSizeORM(value=1, unit="Rows")dataset.keyword = [AlternateName(name="key...
2
26
1
311
6
16
43
16
dataset
['funder', 'converter', 'expected', 'result', 'actual', 'creator']
None
{"Assign": 17, "Expr": 3, "For": 1, "With": 2}
25
28
25
["License", "AlternateName", "AlternateName", "DatasetSizeORM", "AlternateName", "AlternateName", "Contact", "Person", "AgentTable", "Publication", "datetime.datetime", "datetime.datetime", "DbSession", "session.add", "session.add", "session.commit", "converter.convert", "result.json", "open", "path_test_resources", "f...
0
[]
The function (test_aiod_to_schema_dot_org_happy_path) defined within the public class called public.The function start at line 16 and ends at 43. It contains 26 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 25.0 functions, and...
aiondemand_AIOD-rest-api
public
public
0
0
test_hard_delete
def test_hard_delete():now = datetime.datetime.now()deletion_time = now - datetime.timedelta(seconds=10)with DbSession() as session:session.add_all([factory_test_resource(title="test_resource_to_keep", status=EntryStatus.DRAFT,platform="example", platform_resource_identifier=1,date_deleted=None),factory_test_resource(t...
2
28
0
224
4
11
40
11
['deletion_time', 'resources', 'now', 'entries']
None
{"Assign": 4, "Expr": 3, "With": 2}
20
30
20
["datetime.datetime.now", "datetime.timedelta", "DbSession", "session.add_all", "factory_test_resource", "factory_test_resource", "factory_test_resource", "factory_test_resource", "session.commit", "hard_delete.hard_delete_older_than", "datetime.timedelta", "DbSession", "all", "session.scalars", "select", "len", "all",...
0
[]
The function (test_hard_delete) defined within the public class called public.The function start at line 11 and ends at 40. It contains 28 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 20.0 functions, and It has 20.0 function...
aiondemand_AIOD-rest-api
public
public
0
0
test_happy_path
def test_happy_path(client: TestClient):organisation = Organisation(name="organisation",agent_identifier=AgentTable(type="organisation"),)person = Person(name="person",agent_identifier=AgentTable(type="person"),)with DbSession() as session:session.add(person)session.merge(organisation)session.commit()session.delete(per...
1
18
1
135
2
10
28
10
client
['person', 'organisation']
None
{"Assign": 2, "Expr": 5, "With": 1}
22
19
22
["Organisation", "AgentTable", "Person", "AgentTable", "DbSession", "session.add", "session.merge", "session.commit", "session.delete", "session.commit", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select"]
0
[]
The function (test_happy_path) defined within the public class called public.The function start at line 10 and ends at 28. 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 22.0 functions, and It has 22.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
test_happy_path
def test_happy_path(client: TestClient):expertise_a = Expertise(name="just")expertise_b = Expertise(name="an")expertise_c = Expertise(name="example")person_a = Person(name="person a",expertise=[expertise_a, expertise_b],)person_b = Person(name="person b",expertise=[expertise_a, expertise_c],)with DbSession() as session...
2
21
1
154
6
9
30
9
client
['expertise_c', 'person_a', 'expertises', 'expertise_a', 'expertise_b', 'person_b']
None
{"Assign": 6, "Expr": 5, "With": 1}
18
22
18
["Expertise", "Expertise", "Expertise", "Person", "Person", "DbSession", "session.add", "session.add", "session.commit", "session.delete", "session.commit", "len", "all", "session.scalars", "select", "all", "session.scalars", "select"]
0
[]
The function (test_happy_path) defined within the public class called public.The function start at line 9 and ends at 30. It contains 21 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 18.0 functions, and It has 18.0 functions ...
aiondemand_AIOD-rest-api
public
public
0
0
test_happy_path
def test_happy_path(client: TestClient):dataset_distribution = datatype_of_field(Dataset, "distribution")publication_distribution = datatype_of_field(Publication, "distribution")assert not isinstance(dataset_distribution, str)assert not isinstance(publication_distribution, str)dataset_1 = Dataset(name="dataset 1",distr...
3
47
1
306
7
11
59
11
client
['publication_distribution', 'dataset_1', 'dataset_distribution', 'dataset_2', 'publication', 'dataset_distributions', 'publication_distributions']
None
{"Assign": 7, "Expr": 4, "With": 1}
39
49
39
["datatype_of_field", "datatype_of_field", "isinstance", "isinstance", "Dataset", "dataset_distribution", "dataset_distribution", "AIAssetTable", "Dataset", "dataset_distribution", "dataset_distribution", "AIAssetTable", "Publication", "publication_distribution", "publication_distribution", "AIAssetTable", "DbSession",...
0
[]
The function (test_happy_path) defined within the public class called public.The function start at line 11 and ends at 59. It contains 47 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 39.0 functions, and It has 39.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
test_happy_path
def test_happy_path(client: TestClient):dataset = Dataset(ai_asset_identifier=AIAssetTable(type="dataset"),name="dataset 1",spatial_coverage=LocationORM(address=AddressORM(country=Country(name="Belgium")), geo=GeoORM(latitude=37.42242, longitude=-122.08585)),size=DatasetSizeORM(unit="number of rows", value=10),funder=[...
1
29
1
381
1
12
42
12
client
['dataset']
None
{"Assign": 1, "Expr": 4, "With": 1}
69
31
69
["Dataset", "AIAssetTable", "LocationORM", "AddressORM", "Country", "GeoORM", "DatasetSizeORM", "AgentTable", "DbSession", "session.add", "session.commit", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "s...
0
[]
The function (test_happy_path) defined within the public class called public.The function start at line 12 and ends at 42. It contains 29 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 69.0 functions, and It has 69.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
test_happy_path
def test_happy_path(client: TestClient):experiment = Experiment(name="experiment")ml_model = MLModel(name="model", related_experiment=[experiment])link_model = ml_model.__sqlmodel_relationships__["related_experiment"].link_modelwith DbSession() as session:session.add(ml_model)session.commit()assert len(session.scalars(...
1
15
1
182
3
9
24
9
client
['experiment', 'ml_model', 'link_model']
None
{"Assign": 3, "Expr": 4, "With": 1}
31
16
31
["Experiment", "MLModel", "DbSession", "session.add", "session.commit", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select", "session.delete", "session.commit", "len", "all", "session.scalars", "select", "len", "all", "session.scalars", "select...
0
[]
The function (test_happy_path) defined within the public class called public.The function start at line 9 and ends at 24. 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 31.0 functions, and It has 31.0 functions ...
aiondemand_AIOD-rest-api
public
public
0
0
test_happy_path
def test_happy_path(client: TestClient):dataset_media = datatype_of_field(Dataset, "media")dataset_note = datatype_of_field(Dataset, "note")assert not isinstance(dataset_media, str)assert not isinstance(dataset_note, str)alternate_name_a = AlternateName(name="a")alternate_name_b = AlternateName(name="b")alternate_name_...
6
69
1
589
22
14
85
14
client
['relevant_links', 'keyword_c', 'publication', 'dataset_media', 'relevant_link_a', 'relevant_link_d', 'dataset_note', 'alternate_name_b', 'dataset_2', 'alternate_name_a', 'alternate_names', 'dataset_1', 'keyword_d', 'relevant_link_b', 'notes', 'keyword_b', 'alternate_name_d', 'relevant_link_c', 'keyword_a', 'alternate_...
None
{"Assign": 22, "Expr": 4, "With": 1}
62
72
62
["datatype_of_field", "datatype_of_field", "isinstance", "isinstance", "AlternateName", "AlternateName", "AlternateName", "AlternateName", "Keyword", "Keyword", "Keyword", "Keyword", "RelevantLink", "RelevantLink", "RelevantLink", "RelevantLink", "Dataset", "dataset_media", "dataset_media", "dataset_note", "dataset_not...
0
[]
The function (test_happy_path) defined within the public class called public.The function start at line 14 and ends at 85. It contains 69 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 62.0 functions, and It has 62.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
test_middleware_logs_asset_hit._ok
def _ok(): return {"ok": True}written = []import middleware.access_log as mmonkeypatch.setattr(m, "DbSession", lambda: _FakeSession(written), raising=True)client = TestClient(app)r = client.get("/datasets/data_foobar12foobar12foobar12")assert r.status_code == 200assert len(written) == 1entry = written[0]assert entry.re...
1
12
0
90
0
21
35
21
null
[]
None
null
0
0
0
null
0
null
The function (test_middleware_logs_asset_hit._ok) defined within the public class called public.The function start at line 21 and ends at 35. 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..
aiondemand_AIOD-rest-api
public
public
0
0
test_middleware_logs_404_asset
def test_middleware_logs_404_asset(monkeypatch):app = FastAPI()app.add_middleware(AccessLogMiddleware)written = []import middleware.access_log as mmonkeypatch.setattr(m, "DbSession", lambda: _FakeSession(written), raising=True)client = TestClient(app)r = client.get("/v2/ml_models/mdl_bertbertbertbertbertbert")assert r....
1
14
1
96
5
38
54
38
monkeypatch
['client', 'r', 'app', 'entry', 'written']
None
{"Assign": 5, "Expr": 2}
7
17
7
["FastAPI", "app.add_middleware", "monkeypatch.setattr", "_FakeSession", "TestClient", "client.get", "len"]
0
[]
The function (test_middleware_logs_404_asset) defined within the public class called public.The function start at line 38 and ends at 54. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has ...
aiondemand_AIOD-rest-api
public
public
0
0
test_middleware_ignores_non_asset._metrics
def _metrics(): return "ok"written = []import middleware.access_log as mmonkeypatch.setattr(m, "DbSession", lambda: _FakeSession(written), raising=True)client = TestClient(app)assert client.get("/metrics").status_code == 200assert written == []
1
7
0
57
0
61
69
61
null
[]
None
null
0
0
0
null
0
null
The function (test_middleware_ignores_non_asset._metrics) defined within the public class called public.The function start at line 61 and ends at 69. 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..
aiondemand_AIOD-rest-api
public
public
0
0
test_parse_asset_from_path
def test_parse_asset_from_path(path, expected):assert parse_asset_from_path(path) == expected
1
2
2
14
0
21
22
21
path,expected
[]
None
{}
2
2
2
["parse_asset_from_path", "pytest.mark.parametrize"]
0
[]
The function (test_parse_asset_from_path) defined within the public class called public.The function start at line 21 and ends at 22. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [21.0] and does not return any value. It declares 2.0 functions, and It has 2....
aiondemand_AIOD-rest-api
public
public
0
0
test_parse_asset_from_path_with_prefix
def test_parse_asset_from_path_with_prefix(path, expected):from config import DEV_CONFIGDEV_CONFIG['url_prefix'] = 'aiod-api'assert parse_asset_from_path(path) == expected
1
4
2
24
0
30
33
30
path,expected
[]
None
{"Assign": 1}
2
4
2
["parse_asset_from_path", "pytest.mark.parametrize"]
0
[]
The function (test_parse_asset_from_path_with_prefix) defined within the public class called public.The function start at line 30 and ends at 33. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [30.0] and does not return any value. It declares 2.0 functions, an...
aiondemand_AIOD-rest-api
public
public
0
0
db_with_person
def db_with_person(person: Person, mocked_privileged_token: Mock) -> None:with DbSession() as session:session.add(person)session.commit()
1
4
2
31
0
21
24
21
person,mocked_privileged_token
[]
None
{"Expr": 2, "With": 1}
3
4
3
["DbSession", "session.add", "session.commit"]
0
[]
The function (db_with_person) defined within the public class called public.The function start at line 21 and ends at 24. It contains 4 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. It declares 3.0 functions, and It has 3.0 functions ...
aiondemand_AIOD-rest-api
public
public
0
0
resource_name
def resource_name(request: FixtureRequest) -> str:return request.param
1
2
1
13
0
28
29
28
request
[]
str
{"Return": 1}
1
2
1
["pytest.fixture"]
0
[]
The function (resource_name) defined within the public class called public.The function start at line 28 and ends at 29. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function called ...
aiondemand_AIOD-rest-api
public
public
0
0
test_ai_asset_has_endpoints
def test_ai_asset_has_endpoints(client: TestClient,body_asset_with_single_distribution: dict,resource_name: str,auto_publish: None,):"""Test the existence and functionality of endpoints for an AIAsset resource.It uses a mocked request and asserts the success requests to the endpoints:+ "{resource_name}/1/content"+ f"{r...
1
18
4
133
5
32
60
32
client,body_asset_with_single_distribution,resource_name,auto_publish
['default_endpoint', 'body', 'response', 'response0', 'identifier']
None
{"Assign": 6, "Expr": 1, "With": 1}
7
29
7
["copy.deepcopy", "logged_in_user", "client.post", "response.json", "response.json", "client.get", "client.get"]
0
[]
The function (test_ai_asset_has_endpoints) defined within the public class called public.The function start at line 32 and ends at 60. It contains 18 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [32.0] and does not return any value. It declares 7.0 functions, and It has ...
aiondemand_AIOD-rest-api
public
public
0
0
test_endpoints_when_empty_distribution
def test_endpoints_when_empty_distribution(client: TestClient,body_asset: dict,auto_publish: None,):"""Test retrieving content from an AIAsset with an empty distribution list.This test case checks the behavior of the API when attempting to retrieve contentfrom an AIAsset with no distributions. It verifies that the corr...
1
19
3
177
4
63
91
63
client,body_asset,auto_publish
['response0', 'body', 'identifier', 'response']
None
{"Assign": 6, "Expr": 1, "With": 1}
11
29
11
["copy.deepcopy", "logged_in_user", "client.post", "response.json", "response.json", "client.get", "SAMPLE_ENDPOINT.format", "response.json", "client.get", "SAMPLE_ENDPOINT.format", "response0.json"]
0
[]
The function (test_endpoints_when_empty_distribution) defined within the public class called public.The function start at line 63 and ends at 91. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [63.0] and does not return any value. It declares 11.0 functions, ...
aiondemand_AIOD-rest-api
public
public
0
0
body_asset_with_single_distribution
def body_asset_with_single_distribution(body_asset: dict) -> dict:body = copy.deepcopy(body_asset)body["distribution"][0]["content_url"] = TEST_URL1body["distribution"][0]["encoding_format"] = "text/csv"body["distribution"][0]["name"] = "example1.csv"return body
1
6
1
55
1
95
100
95
body_asset
['body']
dict
{"Assign": 4, "Return": 1}
1
6
1
["copy.deepcopy"]
0
[]
The function (body_asset_with_single_distribution) defined within the public class called public.The function start at line 95 and ends at 100. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It h...
aiondemand_AIOD-rest-api
public
public
0
0
test_endpoints_when_single_distribution
def test_endpoints_when_single_distribution(client: TestClient,body_asset_with_single_distribution: dict,db_with_person: None,auto_publish: None,):"""Test retrieving content from an AIAsset with a single distribution.This test case checks the behavior of the API when attempting to retrieve contentfrom an AIAsset with s...
1
25
4
238
8
103
138
103
client,body_asset_with_single_distribution,db_with_person,auto_publish
['response1', 'headers0', 'body', 'headers', 'response2', 'response', 'response0', 'identifier']
None
{"Assign": 9, "Expr": 1, "With": 1}
13
36
13
["copy.deepcopy", "logged_in_user", "client.post", "response.json", "response.json", "client.get", "SAMPLE_ENDPOINT.format", "client.get", "SAMPLE_ENDPOINT.format", "client.get", "SAMPLE_ENDPOINT.format", "client.get", "SAMPLE_ENDPOINT.format"]
0
[]
The function (test_endpoints_when_single_distribution) defined within the public class called public.The function start at line 103 and ends at 138. It contains 25 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [103.0] and does not return any value. It declares 13.0 functio...
aiondemand_AIOD-rest-api
public
public
0
0
body_asset_with_two_distributions
def body_asset_with_two_distributions(body_asset_with_single_distribution: dict) -> dict:body = copy.deepcopy(body_asset_with_single_distribution)distribution = copy.deepcopy(body["distribution"][0])body["distribution"].append(distribution)body["distribution"][1]["content_url"] = TEST_URL2body["distribution"][1]["encod...
1
8
1
78
2
142
149
142
body_asset_with_single_distribution
['distribution', 'body']
dict
{"Assign": 5, "Expr": 1, "Return": 1}
3
8
3
["copy.deepcopy", "copy.deepcopy", "append"]
0
[]
The function (body_asset_with_two_distributions) defined within the public class called public.The function start at line 142 and ends at 149. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It ...
aiondemand_AIOD-rest-api
public
public
0
0
test_endpoints_when_two_distributions
def test_endpoints_when_two_distributions(client: TestClient,body_asset_with_two_distributions: dict,auto_publish: None,):"""Test getting content from an AIAsset with multiple distributions.This test case checks the behavior of the API when attempting to retrieve contentfrom an AIAsset with two distribution. It verifie...
1
27
3
220
7
152
188
152
client,body_asset_with_two_distributions,auto_publish
['response1', 'headers0', 'headers1', 'body', 'response', 'response0', 'identifier']
None
{"Assign": 8, "Expr": 1, "With": 1}
12
37
12
["copy.deepcopy", "logged_in_user", "client.post", "response.json", "response.json", "client.get", "SAMPLE_ENDPOINT.format", "response.json", "client.get", "SAMPLE_ENDPOINT.format", "client.get", "SAMPLE_ENDPOINT.format"]
0
[]
The function (test_endpoints_when_two_distributions) defined within the public class called public.The function start at line 152 and ends at 188. It contains 27 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [152.0] and does not return any value. It declares 12.0 functions...
aiondemand_AIOD-rest-api
public
public
0
0
test_taxonomy_router
def test_taxonomy_router(client: TestClient):response = client.get("/news_categories")assert response.status_code == 200, response.json()terms = {item["term"] for item in response.json()}assert terms.issuperset({"Education"})
2
5
1
52
2
6
10
6
client
['terms', 'response']
None
{"Assign": 2}
4
5
4
["client.get", "response.json", "response.json", "terms.issuperset"]
0
[]
The function (test_taxonomy_router) defined within the public class called public.The function start at line 6 and ends at 10. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 function...
aiondemand_AIOD-rest-api
public
public
0
0
test_taxonomy_router_v2
def test_taxonomy_router_v2(client: TestClient):response = client.get("/news_categorys")assert response.status_code == 200, response.json()terms = {item["term"] for item in response.json()}assert terms.issuperset({"Education"})
2
5
1
52
2
14
18
14
client
['terms', 'response']
None
{"Assign": 2}
5
5
5
["client.get", "response.json", "response.json", "terms.issuperset", "pytest.mark.versions"]
0
[]
The function (test_taxonomy_router_v2) defined within the public class called public.The function start at line 14 and ends at 18. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 func...
aiondemand_AIOD-rest-api
public
public
0
0
test_get_all_unauthenticated
def test_get_all_unauthenticated(client_test_resource: TestClient, engine_test_resource_filled: Engine):"""You don't need authentication for GET"""response = client_test_resource.get("/test_resources")assert response.status_code == 200, response.json()assert len(response.json()) == 1
1
6
2
43
1
9
15
9
client_test_resource,engine_test_resource_filled
['response']
None
{"Assign": 1, "Expr": 1}
4
7
4
["client_test_resource.get", "response.json", "len", "response.json"]
0
[]
The function (test_get_all_unauthenticated) defined within the public class called public.The function start at line 9 and ends at 15. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [9.0] and does not return any value. It declares 4.0 functions, and It has 4....