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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unifyai_unify | public | public | 0 | 0 | test_delete_context | def test_delete_context():unify.log(x=0, context="a/b")contexts = unify.get_contexts()assert len(contexts) == 1assert "a/b" in contextsunify.delete_context("a/b")assert "a/b" not in unify.get_contexts()assert len(unify.get_logs()) == 0 | 1 | 8 | 0 | 60 | 1 | 94 | 101 | 94 | ['contexts'] | None | {"Assign": 1, "Expr": 2} | 7 | 8 | 7 | ["unify.log", "unify.get_contexts", "len", "unify.delete_context", "unify.get_contexts", "len", "unify.get_logs"] | 0 | [] | The function (test_delete_context) defined within the public class called public.The function start at line 94 and ends at 101. 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 7.0 functions, and It has 7.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_add_logs_to_context | def test_add_logs_to_context():l0 = unify.log(x=0, context="a/b")l1 = unify.log(x=1, context="a/b")l2 = unify.log(x=2, context="b/c")l3 = unify.log(x=3, context="b/c")unify.add_logs_to_context(log_ids=[l0.id, l1.id], context="b/c")assert len(unify.get_logs(context="a/b")) == 2assert unify.get_logs(context="a/b", return... | 1 | 15 | 0 | 163 | 4 | 105 | 119 | 105 | ['l0', 'l2', 'l3', 'l1'] | None | {"Assign": 4, "Expr": 1} | 11 | 15 | 11 | ["unify.log", "unify.log", "unify.log", "unify.log", "unify.add_logs_to_context", "len", "unify.get_logs", "unify.get_logs", "len", "unify.get_logs", "unify.get_logs"] | 0 | [] | The function (test_add_logs_to_context) defined within the public class called public.The function start at line 105 and ends at 119. 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 11.0 functions, and It has 11.... | |
unifyai_unify | public | public | 0 | 0 | test_rename_context | def test_rename_context():unify.log(x=0, context="a/b")unify.rename_context("a/b", "a/c")contexts = unify.get_contexts()assert "a/b" not in contextsassert "a/c" in contextslogs = unify.get_logs(context="a/c")assert len(logs) == 1assert logs[0].context == "a/c" | 1 | 9 | 0 | 66 | 2 | 123 | 131 | 123 | ['logs', 'contexts'] | None | {"Assign": 2, "Expr": 2} | 5 | 9 | 5 | ["unify.log", "unify.rename_context", "unify.get_contexts", "unify.get_logs", "len"] | 0 | [] | The function (test_rename_context) defined within the public class called public.The function start at line 123 and ends at 131. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functi... | |
unifyai_unify | public | public | 0 | 0 | test_get_context | def test_get_context():name = "foo"desc = "my_description"is_versioned = Trueallow_duplicates = Trueunify.create_context(name,description=desc,is_versioned=is_versioned,allow_duplicates=allow_duplicates,)context = unify.get_context(name)assert context["name"] == nameassert context["description"] == descassert context["... | 1 | 16 | 0 | 71 | 5 | 135 | 151 | 135 | ['allow_duplicates', 'context', 'is_versioned', 'name', 'desc'] | None | {"Assign": 5, "Expr": 1} | 2 | 17 | 2 | ["unify.create_context", "unify.get_context"] | 0 | [] | The function (test_get_context) defined within the public class called public.The function start at line 135 and ends at 151. 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 2.0 functions, and It has 2.0 function... | |
unifyai_unify | public | public | 0 | 0 | test_context_nesting | def test_context_nesting():current_ctx = unify.get_active_context()assert current_ctx["read"] == ""assert current_ctx["write"] == ""with unify.Context("A"):current_ctx = unify.get_active_context()assert current_ctx["read"] == "A"assert current_ctx["write"] == "A"assert unify.get_context(current_ctx["read"])["name"] == ... | 1 | 19 | 0 | 164 | 1 | 155 | 176 | 155 | ['current_ctx'] | None | {"Assign": 4, "With": 2} | 10 | 22 | 10 | ["unify.get_active_context", "unify.Context", "unify.get_active_context", "unify.get_context", "unify.get_context", "unify.Context", "unify.get_active_context", "unify.get_context", "unify.get_context", "unify.get_active_context"] | 0 | [] | The function (test_context_nesting) defined within the public class called public.The function start at line 155 and ends at 176. It contains 19 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It has 10.0 fu... | |
unifyai_unify | public | public | 0 | 0 | test_context_relative | def test_context_relative():unify.set_context("A", relative=True)unify.set_context("B", relative=True)current_ctx = unify.get_active_context()assert current_ctx["read"] == "A/B"assert current_ctx["write"] == "A/B"assert unify.get_context(current_ctx["read"])["name"] == "A/B"unify.set_context("C", relative=True)current_... | 1 | 12 | 0 | 106 | 1 | 180 | 193 | 180 | ['current_ctx'] | None | {"Assign": 2, "Expr": 3} | 7 | 14 | 7 | ["unify.set_context", "unify.set_context", "unify.get_active_context", "unify.get_context", "unify.set_context", "unify.get_active_context", "unify.get_context"] | 0 | [] | The function (test_context_relative) defined within the public class called public.The function start at line 180 and ends at 193. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7.0 fun... | |
unifyai_unify | public | public | 0 | 0 | test_context_not_relative | def test_context_not_relative():unify.set_context("A", relative=False)current_ctx = unify.get_active_context()assert current_ctx["read"] == "A"assert current_ctx["write"] == "A"assert unify.get_context(current_ctx["read"])["name"] == "A"unify.set_context("B", relative=False)current_ctx = unify.get_active_context()asser... | 1 | 11 | 0 | 96 | 1 | 197 | 208 | 197 | ['current_ctx'] | None | {"Assign": 2, "Expr": 2} | 6 | 12 | 6 | ["unify.set_context", "unify.get_active_context", "unify.get_context", "unify.set_context", "unify.get_active_context", "unify.get_context"] | 0 | [] | The function (test_context_not_relative) defined within the public class called public.The function start at line 197 and ends at 208. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0... | |
unifyai_unify | public | public | 0 | 0 | test_list_datasets | def test_list_datasets():assert len(unify.list_datasets()) == 0unify.log(x=0, context="Datasets/Prod/TestSet")unify.log(x=1, context="Datasets/Prod/TestSet")unify.log(x=0, context="Datasets/Eval/ValidationSet")unify.log(x=1, context="Datasets/Eval/ValidationSet")datasets = unify.list_datasets()assert len(datasets) == 2... | 1 | 18 | 0 | 137 | 1 | 7 | 24 | 7 | ['datasets'] | None | {"Assign": 3, "Expr": 4} | 12 | 18 | 12 | ["len", "unify.list_datasets", "unify.log", "unify.log", "unify.log", "unify.log", "unify.list_datasets", "len", "unify.list_datasets", "len", "unify.list_datasets", "len"] | 0 | [] | The function (test_list_datasets) defined within the public class called public.The function start at line 7 and ends at 24. 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 12.0 functions, and It has 12.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_upload_dataset | def test_upload_dataset():dataset = [{"name": "Dan","age": 31,"gender": "male",},{"name": "Jane","age": 25,"gender": "female",},{"name": "John","age": 35,"gender": "male",},]data = unify.upload_dataset("staff", dataset)assert len(data) == 3 | 1 | 20 | 0 | 70 | 2 | 28 | 47 | 28 | ['data', 'dataset'] | None | {"Assign": 2} | 2 | 20 | 2 | ["unify.upload_dataset", "len"] | 0 | [] | The function (test_upload_dataset) defined within the public class called public.The function start at line 28 and ends at 47. 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 2.0 functions, and It has 2.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_add_dataset_entries | def test_add_dataset_entries():dataset = [{"name": "Dan","age": 31,"gender": "male",},{"name": "Jane","age": 25,"gender": "female",},{"name": "John","age": 35,"gender": "male",},]ids = unify.upload_dataset("staff", dataset)assert len(ids) == 3dataset = unify.download_dataset("staff")assert len(dataset) == 3assert datas... | 1 | 46 | 0 | 247 | 3 | 51 | 96 | 51 | ['new_entries', 'dataset', 'ids'] | None | {"Assign": 6} | 8 | 46 | 8 | ["unify.upload_dataset", "len", "unify.download_dataset", "len", "unify.add_dataset_entries", "len", "unify.download_dataset", "len"] | 0 | [] | The function (test_add_dataset_entries) defined within the public class called public.The function start at line 51 and ends at 96. It contains 46 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 8.0 fu... | |
unifyai_unify | public | public | 0 | 0 | test_download_dataset | def test_download_dataset():dataset = [{"name": "Dan","age": 31,"gender": "male",},{"name": "Jane","age": 25,"gender": "female",},{"name": "John","age": 35,"gender": "male",},]unify.upload_dataset("staff", dataset)data = unify.download_dataset("staff")assert len(data) == 3 | 1 | 21 | 0 | 76 | 2 | 100 | 120 | 100 | ['data', 'dataset'] | None | {"Assign": 2, "Expr": 1} | 3 | 21 | 3 | ["unify.upload_dataset", "unify.download_dataset", "len"] | 0 | [] | The function (test_download_dataset) defined within the public class called public.The function start at line 100 and ends at 120. 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 3.0 functions, and It has 3.0 fun... | |
unifyai_unify | public | public | 0 | 0 | test_delete_dataset | def test_delete_dataset():dataset = [{"name": "Dan","age": 31,"gender": "male",},{"name": "Jane","age": 25,"gender": "female",},{"name": "John","age": 35,"gender": "male",},]unify.upload_dataset("staff", dataset)unify.delete_dataset("staff")assert "staff" not in unify.list_datasets() | 1 | 21 | 0 | 76 | 1 | 124 | 144 | 124 | ['dataset'] | None | {"Assign": 1, "Expr": 2} | 3 | 21 | 3 | ["unify.upload_dataset", "unify.delete_dataset", "unify.list_datasets"] | 0 | [] | The function (test_delete_dataset) defined within the public class called public.The function start at line 124 and ends at 144. 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 3.0 functions, and It has 3.0 funct... | |
unifyai_unify | public | public | 0 | 0 | test_log_entry | def test_log_entry():data = {"question": "What is 1 + 1?","answer": "It's 2",}assert len(unify.get_logs()) == 0log_id = unify.log(**data).idproject_logs = unify.get_logs()assert len(project_logs) and project_logs[0].id == log_idid_log = unify.get_log_by_id(log_id)assert len(id_log) and "question" in id_log.entriesunify... | 6 | 24 | 0 | 186 | 4 | 8 | 31 | 8 | ['project_logs', 'id_log', 'data', 'log_id'] | None | {"Assign": 6, "Expr": 4, "Try": 1} | 18 | 24 | 18 | ["len", "unify.get_logs", "unify.log", "unify.get_logs", "len", "unify.get_log_by_id", "len", "unify.delete_log_fields", "unify.get_log_by_id", "len", "unify.add_log_entries", "unify.get_log_by_id", "len", "unify.delete_logs", "len", "unify.get_logs", "unify.get_log_by_id", "str"] | 0 | [] | The function (test_log_entry) defined within the public class called public.The function start at line 8 and ends at 31. It contains 24 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 18.0 functions, and It has 18.0 functions c... | |
unifyai_unify | public | public | 0 | 0 | test_create_logs | def test_create_logs():entries = [{"a": 0, "b": 1, "c": 2},{"a": 1, "b": 2, "c": 3},{"a": 2, "b": 3, "c": 4},]params = [{"x": -1, "y": -2, "z": -3},{"x": -4, "y": -5, "z": -6},{"x": -7, "y": -8, "z": -9},]unify.create_logs(entries=entries, params=params, batched=False)logs_unbatched = unify.get_logs()assert len(logs_un... | 1 | 18 | 0 | 170 | 4 | 35 | 52 | 35 | ['logs_unbatched', 'params', 'entries', 'logs_batched'] | None | {"Assign": 4, "Expr": 3} | 7 | 18 | 7 | ["unify.create_logs", "unify.get_logs", "len", "unify.delete_logs", "unify.create_logs", "unify.get_logs", "len"] | 0 | [] | The function (test_create_logs) defined within the public class called public.The function start at line 35 and ends at 52. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7.0 functions ... | |
unifyai_unify | public | public | 0 | 0 | test_create_logs_large_body | def test_create_logs_large_body():entries = [{"img": "a" * 100000}] * 100unify.create_logs(entries=entries)assert len(unify.get_logs()) == 100 | 1 | 4 | 0 | 36 | 1 | 56 | 59 | 56 | ['entries'] | None | {"Assign": 1, "Expr": 1} | 3 | 4 | 3 | ["unify.create_logs", "len", "unify.get_logs"] | 0 | [] | The function (test_create_logs_large_body) defined within the public class called public.The function start at line 56 and ends at 59. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 ... | |
unifyai_unify | public | public | 0 | 0 | test_update_logs | def test_update_logs():log0 = unify.log(a=0, b=1)unify.update_logs(logs=log0, entries={"a": 1}, overwrite=True)assert unify.get_log_by_id(log0.id).entries["a"] == 1unify.update_logs(logs=log0, entries={"c": 2})assert unify.get_log_by_id(log0.id).entries["c"] == 2log1 = unify.log(a=1, b=2)unify.update_logs(logs=[log0, l... | 1 | 10 | 0 | 164 | 2 | 63 | 72 | 63 | ['log0', 'log1'] | None | {"Assign": 2, "Expr": 3} | 9 | 10 | 9 | ["unify.log", "unify.update_logs", "unify.get_log_by_id", "unify.update_logs", "unify.get_log_by_id", "unify.log", "unify.update_logs", "unify.get_log_by_id", "unify.get_log_by_id"] | 0 | [] | The function (test_update_logs) defined within the public class called public.The function start at line 63 and ends at 72. It contains 10 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 functions ... | |
unifyai_unify | public | public | 0 | 0 | test_duplicate_log_field | def test_duplicate_log_field():data = {"system_prompt": "You are a weather assistant","user_prompt": "hello world",}assert len(unify.get_logs()) == 0log = unify.log(**data)assert len(unify.get_logs()) == 1new_data = {"system_prompt": "You are a maths assistant","user_prompt": "hi earth",}with pytest.raises(Exception):l... | 1 | 14 | 0 | 74 | 3 | 76 | 89 | 76 | ['new_data', 'data', 'log'] | None | {"Assign": 3, "Expr": 1, "With": 1} | 7 | 14 | 7 | ["len", "unify.get_logs", "unify.log", "len", "unify.get_logs", "pytest.raises", "log.add_entries"] | 0 | [] | The function (test_duplicate_log_field) defined within the public class called public.The function start at line 76 and ends at 89. 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 7.0 fu... | |
unifyai_unify | public | public | 0 | 0 | test_log_function_logs_code.my_func | def my_func(a):return a + 1 | 1 | 2 | 1 | 9 | 0 | 94 | 95 | 94 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_log_function_logs_code.my_func) defined within the public class called public.The function start at line 94 and ends at 95. 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.. |
unifyai_unify | public | public | 0 | 0 | test_log_function_logs_code | def test_log_function_logs_code():def my_func(a):return a + 1unify.log(my_func=my_func)logs = unify.get_logs()assert len(logs) == 1assert logs[0].entries["my_func"] == "def my_func(a):\nreturn a + 1\n" | 1 | 6 | 0 | 40 | 1 | 93 | 100 | 93 | ['logs'] | Returns | {"Assign": 1, "Expr": 1, "Return": 1} | 3 | 8 | 3 | ["unify.log", "unify.get_logs", "len"] | 0 | [] | The function (test_log_function_logs_code) defined within the public class called public.The function start at line 93 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 this function return a value. It declares 3.0 functions, and It has... | |
unifyai_unify | public | public | 0 | 0 | test_atomic_functions | def test_atomic_functions():log1 = {"system_prompt": "You are a weather assistant","user_prompt": "hello world","score": 0.2,}log2 = {"system_prompt": "You are a new weather assistant","user_prompt": "hello world","score": 0.3,}log3 = {"system_prompt": "You are a new weather assistant","user_prompt": "nothing","score":... | 1 | 25 | 0 | 104 | 4 | 104 | 129 | 104 | ['log3', 'logs_metric', 'log1', 'log2'] | None | {"Assign": 4, "Expr": 3} | 4 | 26 | 4 | ["unify.log", "unify.log", "unify.log", "unify.get_logs_metric"] | 0 | [] | The function (test_atomic_functions) defined within the public class called public.The function start at line 104 and ends at 129. It contains 25 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 fun... | |
unifyai_unify | public | public | 0 | 0 | test_log_ordering | def test_log_ordering():for i in range(25):unify.log(a=i,b=i + 1,c=i + 2,)logs = unify.get_logs()for lg in logs:assert list(lg.entries.keys()) == ["a", "b", "c"] | 3 | 10 | 0 | 64 | 1 | 133 | 142 | 133 | ['logs'] | None | {"Assign": 1, "Expr": 1, "For": 2} | 5 | 10 | 5 | ["range", "unify.log", "unify.get_logs", "list", "lg.entries.keys"] | 0 | [] | The function (test_log_ordering) defined within the public class called public.The function start at line 133 and ends at 142. It contains 10 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs | def test_get_logs():logs = unify.get_logs()assert len(logs) == 0, "There should be no logs initially."log_data1 = {"system_prompt": "You are a weather assistant","user_prompt": "What is the weather today?","score": 0.9,}unify.log(**log_data1)log_data2 = {"system_prompt": "You are a travel assistant","user_prompt": "Wha... | 1 | 75 | 0 | 345 | 11 | 146 | 221 | 146 | ['filtered_logs', 'logical_logs', 'logs', 'string_comparison_logs', 'log_data3', 'multiple_filtered_logs', 'nonexistent_logs', 'bracket_logs', 'log_data2', 'comparison_logs', 'log_data1'] | None | {"Assign": 14, "Expr": 3} | 27 | 76 | 27 | ["unify.get_logs", "len", "unify.log", "unify.log", "unify.log", "unify.get_logs", "len", "unify.get_logs", "len", "entries.get", "unify.get_logs", "len", "unify.get_logs", "len", "unify.get_logs", "len", "entries.get", "unify.get_logs", "len", "unify.get_logs", "len", "unify.get_logs", "len", "unify.get_logs", "len", ... | 0 | [] | The function (test_get_logs) defined within the public class called public.The function start at line 146 and ends at 221. It contains 75 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 27.0 functions, and It has 27.0 functions... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_from_ids | def test_get_logs_from_ids():logs = [unify.log(x=i) for i in range(5)]ids = [l.id for l in logs]logs_from_ids = unify.get_logs(from_ids=[ids[0]])assert len(logs_from_ids) == 1assert logs_from_ids[0].id == ids[0]logs_from_ids = unify.get_logs(from_ids=ids)assert len(logs_from_ids) == 5for l in logs_from_ids:assert l.id ... | 5 | 14 | 0 | 134 | 3 | 225 | 241 | 225 | ['logs', 'logs_from_ids', 'ids'] | None | {"Assign": 5, "For": 2} | 8 | 17 | 8 | ["unify.log", "range", "unify.get_logs", "len", "unify.get_logs", "len", "unify.get_logs", "len"] | 0 | [] | The function (test_get_logs_from_ids) defined within the public class called public.The function start at line 225 and ends at 241. It contains 14 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 8.0 functions, and It has 8.0 fu... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_from_fields | def test_get_logs_from_fields():[unify.log(x=i) for i in range(3)]logs = unify.get_logs(from_fields=["x"])assert len(logs) == 3[unify.log(y=i) for i in range(3)]logs = unify.get_logs(from_fields=["y"])assert len(logs) == 3logs = unify.get_logs(from_fields=["x", "y"])assert len(logs) == 6 | 3 | 9 | 0 | 97 | 1 | 245 | 255 | 245 | ['logs'] | None | {"Assign": 3, "Expr": 2} | 10 | 11 | 10 | ["unify.log", "range", "unify.get_logs", "len", "unify.log", "range", "unify.get_logs", "len", "unify.get_logs", "len"] | 0 | [] | The function (test_get_logs_from_fields) defined within the public class called public.The function start at line 245 and ends at 255. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It has 10.... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_exclude_fields | def test_get_logs_exclude_fields():[unify.log(x=i) for i in range(3)]assert len(unify.get_logs()) == 3logs = unify.get_logs(exclude_fields=["x"])assert len(logs) == 0[unify.log(y=i) for i in range(3)]logs = unify.get_logs(exclude_fields=["x"])assert len(logs) == 3logs = unify.get_logs(exclude_fields=["x", "y"])assert l... | 3 | 10 | 0 | 108 | 1 | 259 | 271 | 259 | ['logs'] | None | {"Assign": 3, "Expr": 2} | 12 | 13 | 12 | ["unify.log", "range", "len", "unify.get_logs", "unify.get_logs", "len", "unify.log", "range", "unify.get_logs", "len", "unify.get_logs", "len"] | 0 | [] | The function (test_get_logs_exclude_fields) defined within the public class called public.The function start at line 259 and ends at 271. It contains 10 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 12.0 functions, and It has... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_exclude_ids | def test_get_logs_exclude_ids():logs = [unify.log(x=i) for i in range(5)]ids = [l.id for l in logs]logs_exclude_ids = unify.get_logs(exclude_ids=[ids[0]])assert len(logs_exclude_ids) == 4for l in logs_exclude_ids:assert l.id != ids[0]logs_exclude_ids = unify.get_logs(exclude_ids=ids)assert len(logs_exclude_ids) == 0log... | 4 | 11 | 0 | 109 | 3 | 275 | 288 | 275 | ['logs', 'logs_exclude_ids', 'ids'] | None | {"Assign": 5, "For": 1} | 8 | 14 | 8 | ["unify.log", "range", "unify.get_logs", "len", "unify.get_logs", "len", "unify.get_logs", "len"] | 0 | [] | The function (test_get_logs_exclude_ids) defined within the public class called public.The function start at line 275 and ends at 288. It contains 11 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_value_limit | def test_get_logs_value_limit():msg = "hello world"unify.log(msg=msg)logs = unify.get_logs(value_limit=5)assert len(logs) == 1assert logs[0].entries["msg"] == msg[:5] + "..."logs = unify.get_logs(value_limit=None)assert logs[0].entries["msg"] == msg | 1 | 8 | 0 | 72 | 2 | 292 | 300 | 292 | ['logs', 'msg'] | None | {"Assign": 3, "Expr": 1} | 4 | 9 | 4 | ["unify.log", "unify.get_logs", "len", "unify.get_logs"] | 0 | [] | The function (test_get_logs_value_limit) defined within the public class called public.The function start at line 292 and ends at 300. 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 4.0 functions, and It has 4.0 ... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_group_by | def test_get_logs_group_by():for i in range(2):for y in range(3):unify.log(x=i, y=y)logs = unify.get_logs(group_by=["x"])assert isinstance(logs, unify.LogGroup)assert logs.field == "x"assert len(logs.value) == 2assert "0" in logs.valueassert "1" in logs.valueassert len(logs.value["0"]) == 3assert len(logs.value["1"]) =... | 3 | 16 | 0 | 140 | 1 | 304 | 321 | 304 | ['logs'] | None | {"Assign": 2, "Expr": 1, "For": 2} | 11 | 18 | 11 | ["range", "range", "unify.log", "unify.get_logs", "isinstance", "len", "len", "len", "unify.get_logs", "isinstance", "len"] | 0 | [] | The function (test_get_logs_group_by) defined within the public class called public.The function start at line 304 and ends at 321. It contains 16 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 11.0 functions, and It has 11.0 ... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_group_by_entries | def test_get_logs_group_by_entries():unify.log(name="John", age=21, msg="Hello")unify.log(name="John", age=21, msg="Bye")logs = unify.get_logs(group_by=["name", "msg"])assert isinstance(logs, unify.LogGroup)assert logs.field == "name"assert "John" in logs.valuesecond_group = logs.value["John"]assert isinstance(second_g... | 1 | 18 | 0 | 174 | 3 | 325 | 346 | 325 | ['logs', 'second_group', 'log'] | None | {"Assign": 4, "Expr": 2} | 5 | 22 | 5 | ["unify.log", "unify.log", "unify.get_logs", "isinstance", "isinstance"] | 0 | [] | The function (test_get_logs_group_by_entries) defined within the public class called public.The function start at line 325 and ends at 346. 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 5.0 functions, and It ha... | |
unifyai_unify | public | public | 0 | 0 | test_get_logs_group_by_not_nested | def test_get_logs_group_by_not_nested():for i in range(2):for y in range(3):unify.log(x=i, y=y)logs = unify.get_logs(group_by=["x"], nested_groups=False)assert isinstance(logs, list)assert len(logs) == 1for _, v in logs[0].value.items():assert isinstance(v, list)for log in v:assert isinstance(log, unify.Log) | 5 | 11 | 0 | 99 | 1 | 350 | 361 | 350 | ['logs'] | None | {"Assign": 1, "Expr": 1, "For": 4} | 9 | 12 | 9 | ["range", "range", "unify.log", "unify.get_logs", "isinstance", "len", "value.items", "isinstance", "isinstance"] | 0 | [] | The function (test_get_logs_group_by_not_nested) defined within the public class called public.The function start at line 350 and ends at 361. It contains 11 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 9.0 functions, and It... | |
unifyai_unify | public | public | 0 | 0 | test_get_source | def test_get_source():source = unify.get_source()assert "source = unify.get_source()" in source | 1 | 3 | 0 | 15 | 1 | 365 | 367 | 365 | ['source'] | None | {"Assign": 1} | 1 | 3 | 1 | ["unify.get_source"] | 0 | [] | The function (test_get_source) defined within the public class called public.The function start at line 365 and ends at 367. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function cal... | |
unifyai_unify | public | public | 0 | 0 | test_delete_logs_by_ids | def test_delete_logs_by_ids():logs = [unify.log(x=i) for i in range(3)]assert len(unify.get_logs()) == 3unify.delete_logs(logs=logs[0])logs = unify.get_logs()assert len(logs) == 2assert all(log.id != logs[0].id for log in logs)unify.delete_logs(logs=logs[1:])assert len(unify.get_logs()) == 0 | 3 | 9 | 0 | 100 | 1 | 371 | 381 | 371 | ['logs'] | None | {"Assign": 2, "Expr": 2} | 11 | 11 | 11 | ["unify.log", "range", "len", "unify.get_logs", "unify.delete_logs", "unify.get_logs", "len", "all", "unify.delete_logs", "len", "unify.get_logs"] | 0 | [] | The function (test_delete_logs_by_ids) defined within the public class called public.The function start at line 371 and ends at 381. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 11.0 functions, and It has 11.0 ... | |
unifyai_unify | public | public | 0 | 0 | test_create_fields | def test_create_fields():field_name = "full_name"unify.create_fields(fields={field_name: "str"})fields = unify.get_fields()assert field_name in fieldsassert fields[field_name]["data_type"] == "str" | 1 | 6 | 0 | 40 | 2 | 385 | 390 | 385 | ['field_name', 'fields'] | None | {"Assign": 2, "Expr": 1} | 2 | 6 | 2 | ["unify.create_fields", "unify.get_fields"] | 0 | [] | The function (test_create_fields) defined within the public class called public.The function start at line 385 and ends at 390. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_rename_field | def test_rename_field():field_name = "full_name"unify.create_fields([field_name])fields = unify.get_fields()assert field_name in fieldsnew_field_name = "first_name"unify.rename_field(name=field_name, new_name=new_field_name)fields = unify.get_fields()assert new_field_name in fieldsassert field_name not in fields | 1 | 10 | 0 | 57 | 3 | 394 | 405 | 394 | ['field_name', 'new_field_name', 'fields'] | None | {"Assign": 4, "Expr": 2} | 4 | 12 | 4 | ["unify.create_fields", "unify.get_fields", "unify.rename_field", "unify.get_fields"] | 0 | [] | The function (test_rename_field) defined within the public class called public.The function start at line 394 and ends at 405. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_get_fields | def test_get_fields():assert len(unify.get_fields()) == 0field_name = "full_name"unify.create_fields(fields={field_name: None})fields = unify.get_fields()assert field_name in fields | 1 | 6 | 0 | 41 | 2 | 409 | 415 | 409 | ['field_name', 'fields'] | None | {"Assign": 2, "Expr": 1} | 4 | 7 | 4 | ["len", "unify.get_fields", "unify.create_fields", "unify.get_fields"] | 0 | [] | The function (test_get_fields) defined within the public class called public.The function start at line 409 and ends at 415. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It has 4.0 functions ... | |
unifyai_unify | public | public | 0 | 0 | test_delete_fields | def test_delete_fields():field_name = "full_name"unify.create_fields(fields={field_name: None})fields = unify.get_fields()assert field_name in fieldsunify.log(first_name="John")assert len(unify.get_logs()) == 1unify.delete_fields([field_name])assert len(unify.get_logs()) == 0fields = unify.get_fields()assert field_name... | 1 | 11 | 0 | 80 | 2 | 419 | 432 | 419 | ['field_name', 'fields'] | None | {"Assign": 3, "Expr": 3} | 9 | 14 | 9 | ["unify.create_fields", "unify.get_fields", "unify.log", "len", "unify.get_logs", "unify.delete_fields", "len", "unify.get_logs", "unify.get_fields"] | 0 | [] | The function (test_delete_fields) defined within the public class called public.The function start at line 419 and ends at 432. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has 9.0 functi... | |
unifyai_unify | public | public | 0 | 0 | test_project | def test_project():name = "my_project"if name in unify.list_projects():unify.delete_project(name)assert name not in unify.list_projects()unify.create_project(name)assert name in unify.list_projects()new_name = "my_project1"unify.rename_project(name, new_name)assert new_name in unify.list_projects()unify.delete_project(... | 2 | 12 | 0 | 79 | 2 | 6 | 17 | 6 | ['name', 'new_name'] | None | {"Assign": 2, "Expr": 4, "If": 1} | 9 | 12 | 9 | ["unify.list_projects", "unify.delete_project", "unify.list_projects", "unify.create_project", "unify.list_projects", "unify.rename_project", "unify.list_projects", "unify.delete_project", "unify.list_projects"] | 0 | [] | The function (test_project) defined within the public class called public.The function start at line 6 and ends at 17. It contains 12 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has 9.0 functions calle... | |
unifyai_unify | public | public | 0 | 0 | test_project_thread_lock | def test_project_thread_lock():# all 10 threads would try to create the project at the same time without# thread locking, but only one should acquire the lock, and this should passunify.map(unify.log,project="test_project",a=[1] * 10,b=[2] * 10,c=[3] * 10,from_args=True,)unify.delete_project("test_project") | 1 | 10 | 0 | 51 | 0 | 20 | 31 | 20 | [] | None | {"Expr": 2} | 2 | 12 | 2 | ["unify.map", "unify.delete_project"] | 0 | [] | The function (test_project_thread_lock) defined within the public class called public.The function start at line 20 and ends at 31. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 fu... | |
unifyai_unify | public | public | 0 | 0 | test_delete_project_logs | def test_delete_project_logs():[unify.log(x=i) for i in range(10)]assert len(unify.get_logs()) == 10unify.delete_project_logs("test_delete_project_logs")assert len(unify.get_logs()) == 0assert "test_delete_project_logs" in unify.list_projects() | 2 | 6 | 0 | 57 | 0 | 35 | 40 | 35 | [] | None | {"Expr": 2} | 8 | 6 | 8 | ["unify.log", "range", "len", "unify.get_logs", "unify.delete_project_logs", "len", "unify.get_logs", "unify.list_projects"] | 0 | [] | The function (test_delete_project_logs) defined within the public class called public.The function start at line 35 and ends at 40. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 fun... | |
unifyai_unify | public | public | 0 | 0 | test_delete_project_contexts | def test_delete_project_contexts():unify.create_context("foo")unify.create_context("bar")assert len(unify.get_contexts()) == 2unify.delete_project_contexts("test_delete_project_contexts")assert len(unify.get_contexts()) == 0assert "test_delete_project_contexts" in unify.list_projects() | 1 | 7 | 0 | 52 | 0 | 44 | 52 | 44 | [] | None | {"Expr": 3} | 8 | 9 | 8 | ["unify.create_context", "unify.create_context", "len", "unify.get_contexts", "unify.delete_project_contexts", "len", "unify.get_contexts", "unify.list_projects"] | 0 | [] | The function (test_delete_project_contexts) defined within the public class called public.The function start at line 44 and ends at 52. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0... | |
unifyai_unify | public | public | 0 | 0 | test_provider_fallback | def test_provider_fallback():unify.Unify("claude-4-opus@anthropic->aws-bedrock").generate("Hello.") | 1 | 2 | 0 | 15 | 0 | 4 | 5 | 4 | [] | None | {"Expr": 1} | 2 | 2 | 2 | ["generate", "unify.Unify"] | 0 | [] | The function (test_provider_fallback) defined within the public class called public.The function start at line 4 and ends at 5. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functio... | |
unifyai_unify | public | public | 0 | 0 | test_model_fallback | def test_model_fallback():unify.Unify("gemini-1.5-pro->gemini-1.5-flash@vertex-ai").generate("Hello.") | 1 | 2 | 0 | 15 | 0 | 8 | 9 | 8 | [] | None | {"Expr": 1} | 2 | 2 | 2 | ["generate", "unify.Unify"] | 0 | [] | The function (test_model_fallback) defined within the public class called public.The function start at line 8 and ends at 9. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions ... | |
unifyai_unify | public | public | 0 | 0 | test_endpoint_fallback | def test_endpoint_fallback():unify.Unify("llama-3.1-405b-chat@together-ai->gpt-4o@openai",).generate("Hello.") | 1 | 4 | 0 | 16 | 0 | 12 | 15 | 12 | [] | None | {"Expr": 1} | 2 | 4 | 2 | ["generate", "unify.Unify"] | 0 | [] | The function (test_endpoint_fallback) defined within the public class called public.The function start at line 12 and ends at 15. 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 has 2.0 funct... | |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_invalid_api_key_raises_authentication_error | def test_invalid_api_key_raises_authentication_error(self) -> None:with pytest.raises(Exception):client = Unify(api_key="invalid_api_key",endpoint="gpt-4o@openai",)client.generate(user_message="hello") | 1 | 7 | 1 | 36 | 0 | 15 | 21 | 15 | self | [] | None | {"Assign": 1, "Expr": 1, "With": 1} | 3 | 7 | 3 | ["pytest.raises", "Unify", "client.generate"] | 0 | [] | The function (test_invalid_api_key_raises_authentication_error) defined within the public class called TestUnifyBasics.The function start at line 15 and ends at 21. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_incorrect_model_name_raises_internal_server_error | def test_incorrect_model_name_raises_internal_server_error(self) -> None:with pytest.raises(Exception):Unify(model="wong-model-name") | 1 | 3 | 1 | 21 | 0 | 23 | 25 | 23 | self | [] | None | {"Expr": 1, "With": 1} | 2 | 3 | 2 | ["pytest.raises", "Unify"] | 0 | [] | The function (test_incorrect_model_name_raises_internal_server_error) defined within the public class called TestUnifyBasics.The function start at line 23 and ends at 25. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It decl... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_generate_returns_string_when_stream_false | def test_generate_returns_string_when_stream_false(self) -> None:client = Unify(endpoint="gpt-4o@openai",)result = client.generate(user_message="hello", stream=False)assert isinstance(result, str) | 1 | 6 | 1 | 37 | 0 | 27 | 32 | 27 | self | [] | None | {"Assign": 2} | 3 | 6 | 3 | ["Unify", "client.generate", "isinstance"] | 0 | [] | The function (test_generate_returns_string_when_stream_false) defined within the public class called TestUnifyBasics.The function start at line 27 and ends at 32. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_traced_and_cached | def test_traced_and_cached(self) -> None:client = Unify(endpoint="gpt-4o@openai",traced=True,cache=True,)client.generate("hello") | 1 | 7 | 1 | 30 | 0 | 34 | 40 | 34 | self | [] | None | {"Assign": 1, "Expr": 1} | 2 | 7 | 2 | ["Unify", "client.generate"] | 0 | [] | The function (test_traced_and_cached) defined within the public class called TestUnifyBasics.The function start at line 34 and ends at 40. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has ... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_copy_client | def test_copy_client(self) -> None:client = Unify(endpoint="gpt-4o@openai",)client.set_system_message("you are a helpful agent")clone = client.copy()assert clone.endpoint == "gpt-4o@openai"assert clone.system_message == "you are a helpful agent"clone.set_system_message("you are not helpful")assert clone.system_message ... | 1 | 14 | 1 | 77 | 0 | 42 | 55 | 42 | self | [] | None | {"Assign": 2, "Expr": 3} | 5 | 14 | 5 | ["Unify", "client.set_system_message", "client.copy", "clone.set_system_message", "clone.set_endpoint"] | 0 | [] | The function (test_copy_client) defined within the public class called TestUnifyBasics.The function start at line 42 and ends at 55. 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 5.0 functions, and It has 5.0 f... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_structured_output | def test_structured_output(self) -> None:client = Unify(endpoint="gpt-4o@openai",response_format=Response,)result = client.generate(user_message="what is 1 + 1?",return_full_completion=True,)assert isinstance(result, ParsedChatCompletion)assert isinstance(result.choices[0].message.content, str)result = json.loads(resul... | 1 | 21 | 1 | 131 | 0 | 57 | 79 | 57 | self | [] | None | {"Assign": 5} | 10 | 23 | 10 | ["Unify", "client.generate", "isinstance", "isinstance", "json.loads", "isinstance", "client.generate", "isinstance", "json.loads", "isinstance"] | 0 | [] | The function (test_structured_output) defined within the public class called TestUnifyBasics.The function start at line 57 and ends at 79. 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 10.0 functions, and It ha... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_structured_output_w_caching | def test_structured_output_w_caching(self) -> None:client = Unify(endpoint="gpt-4o@openai",response_format=Response,cache=True,)assert json.loads(client.generate(user_message="what is 1 + 1?"))["number"] == 2assert json.loads(client.generate(user_message="what is 1 + 1?"))["number"] == 2 | 1 | 8 | 1 | 62 | 0 | 81 | 88 | 81 | self | [] | None | {"Assign": 1} | 5 | 8 | 5 | ["Unify", "json.loads", "client.generate", "json.loads", "client.generate"] | 0 | [] | The function (test_structured_output_w_caching) defined within the public class called TestUnifyBasics.The function start at line 81 and ends at 88. 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 5.0 functions, an... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_generate_returns_generator_when_stream_true | def test_generate_returns_generator_when_stream_true(self) -> None:client = Unify(endpoint="gpt-4o@openai",)result = client.generate(user_message="hello", stream=True)assert isinstance(result, GeneratorType) | 1 | 6 | 1 | 37 | 0 | 90 | 95 | 90 | self | [] | None | {"Assign": 2} | 3 | 6 | 3 | ["Unify", "client.generate", "isinstance"] | 0 | [] | The function (test_generate_returns_generator_when_stream_true) defined within the public class called TestUnifyBasics.The function start at line 90 and ends at 95. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_default_params_handled_correctly | def test_default_params_handled_correctly(self) -> None:client = Unify(endpoint="gpt-4o@openai",n=2,return_full_completion=True,)result = client.generate(user_message="hello")assert len(result.choices) == 2 | 1 | 8 | 1 | 43 | 0 | 97 | 104 | 97 | self | [] | None | {"Assign": 2} | 3 | 8 | 3 | ["Unify", "client.generate", "len"] | 0 | [] | The function (test_default_params_handled_correctly) defined within the public class called TestUnifyBasics.The function start at line 97 and ends at 104. 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 functio... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_setter_chaining | def test_setter_chaining(self):client = Unify("gpt-4o@openai")client.set_temperature(0.5).set_n(2)assert client.temperature == 0.5assert client.n == 2 | 1 | 5 | 1 | 38 | 0 | 106 | 110 | 106 | self | [] | None | {"Assign": 1, "Expr": 1} | 3 | 5 | 3 | ["Unify", "set_n", "client.set_temperature"] | 0 | [] | The function (test_setter_chaining) defined within the public class called TestUnifyBasics.The function start at line 106 and ends at 110. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has ... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_stateful | def test_stateful(self):# via generateclient = Unify("gpt-4o@openai", stateful=True)client.set_system_message("you are a good mathematician.")client.generate("What is 1 + 1?")client.generate("How do you know?")assert len(client.messages) == 5assert client.messages[0]["role"] == "system"assert client.messages[1]["role"]... | 1 | 30 | 1 | 188 | 0 | 112 | 145 | 112 | self | [] | None | {"Assign": 2, "Expr": 6} | 10 | 34 | 10 | ["Unify", "client.set_system_message", "client.generate", "client.generate", "len", "Unify", "client.set_stateful", "client.set_system_message", "client.append_messages", "len"] | 0 | [] | The function (test_stateful) defined within the public class called TestUnifyBasics.The function start at line 112 and ends at 145. It contains 30 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It has 10.0 ... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_json_structor | def test_json_structor(self):client = Unify(endpoint="gpt-4o@openai",temperature=0.5,)serialized = client.json()assert serializedassert serialized["endpoint"] == "gpt-4o@openai" | 1 | 8 | 1 | 36 | 0 | 147 | 154 | 147 | self | [] | None | {"Assign": 2} | 2 | 8 | 2 | ["Unify", "client.json"] | 0 | [] | The function (test_json_structor) defined within the public class called TestUnifyBasics.The function start at line 147 and ends at 154. 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.... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_invalid_api_key_raises_authentication_error | async def test_invalid_api_key_raises_authentication_error(self) -> None:with pytest.raises(Exception):async_client = AsyncUnify(api_key="invalid_api_key",endpoint="gpt-4o@openai",)await async_client.generate(user_message="hello") | 1 | 7 | 1 | 37 | 0 | 159 | 165 | 159 | self | [] | None | {"Assign": 1, "Expr": 1, "With": 1} | 3 | 7 | 3 | ["pytest.raises", "Unify", "client.generate"] | 0 | [] | The function (test_invalid_api_key_raises_authentication_error) defined within the public class called TestUnifyBasics.The function start at line 159 and ends at 165. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_incorrect_model_name_raises_internal_server_error | def test_incorrect_model_name_raises_internal_server_error(self) -> None:with pytest.raises(Exception):Unify(model="wong-model-name") | 1 | 3 | 1 | 21 | 0 | 167 | 169 | 23 | self | [] | None | {"Expr": 1, "With": 1} | 2 | 3 | 2 | ["pytest.raises", "Unify"] | 0 | [] | The function (test_incorrect_model_name_raises_internal_server_error) defined within the public class called TestUnifyBasics.The function start at line 167 and ends at 169. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It de... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_generate_returns_string_when_stream_false | async def test_generate_returns_string_when_stream_false(self) -> None:async_client = AsyncUnify(endpoint="gpt-4o@openai",)result = await async_client.generate(user_message="hello", stream=False)assert isinstance(result, str) | 1 | 6 | 1 | 38 | 0 | 172 | 177 | 172 | self | [] | None | {"Assign": 2} | 3 | 6 | 3 | ["Unify", "client.generate", "isinstance"] | 0 | [] | The function (test_generate_returns_string_when_stream_false) defined within the public class called TestUnifyBasics.The function start at line 172 and ends at 177. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_generate_returns_generator_when_stream_true | async def test_generate_returns_generator_when_stream_true(self) -> None:async_client = AsyncUnify(endpoint="gpt-4o@openai",)result = await async_client.generate(user_message="hello", stream=True)assert isinstance(result, AsyncGeneratorType) | 1 | 6 | 1 | 38 | 0 | 179 | 184 | 179 | self | [] | None | {"Assign": 2} | 3 | 6 | 3 | ["Unify", "client.generate", "isinstance"] | 0 | [] | The function (test_generate_returns_generator_when_stream_true) defined within the public class called TestUnifyBasics.The function start at line 179 and ends at 184. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares... |
unifyai_unify | TestUnifyBasics | public | 0 | 0 | test_default_params_handled_correctly | async def test_default_params_handled_correctly(self) -> None:async_client = AsyncUnify(endpoint="gpt-4o@openai",n=2,return_full_completion=True,)result = await async_client.generate(user_message="hello")assert len(result.choices) == 2 | 1 | 8 | 1 | 44 | 0 | 187 | 194 | 187 | self | [] | None | {"Assign": 2} | 3 | 8 | 3 | ["Unify", "client.generate", "len"] | 0 | [] | The function (test_default_params_handled_correctly) defined within the public class called TestUnifyBasics.The function start at line 187 and ends at 194. 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 functi... |
unifyai_unify | SimulateInput | public | 0 | 0 | __init__ | def __init__(self):self._messages = ["What is the capital of Spain? Be succinct.","Who is their most famous sports player? Be succinct.","quit",]self._count = 0self._true_input = None | 1 | 8 | 1 | 27 | 0 | 9 | 16 | 9 | self | [] | None | {"Assign": 3} | 0 | 8 | 0 | [] | 14,667 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.AllocationError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.ContentError.__init__", "_... | The function (__init__) defined within the public class called SimulateInput.The function start at line 9 and ends at 16. 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 has 14667.0 functions calling this function which are... |
unifyai_unify | SimulateInput | public | 0 | 0 | _new_input | def _new_input(self):message = self._messages[self._count]self._count += 1print(message)return message | 1 | 5 | 1 | 26 | 0 | 18 | 22 | 18 | self | [] | Returns | {"Assign": 1, "AugAssign": 1, "Expr": 1, "Return": 1} | 1 | 5 | 1 | ["print"] | 0 | [] | The function (_new_input) defined within the public class called SimulateInput.The function start at line 18 and ends at 22. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, and It has 1.0 function... |
unifyai_unify | SimulateInput | public | 0 | 0 | __enter__ | def __enter__(self):self._true_input = builtins.__dict__["input"]builtins.__dict__["input"] = self._new_input | 1 | 3 | 1 | 25 | 0 | 24 | 26 | 24 | self | [] | None | {"Assign": 2} | 0 | 3 | 0 | [] | 35 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.contexts_py.Functor.__enter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__enter__", "_.content.gdrive.M... | The function (__enter__) defined within the public class called SimulateInput.The function start at line 24 and ends at 26. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 35.0 functions calling this function which are ... |
unifyai_unify | SimulateInput | public | 0 | 0 | __exit__ | def __exit__(self, exc_type, exc_value, tb):builtins.__dict__["input"] = self._true_inputself._count = 0if exc_type is not None:traceback.print_exception(exc_type, exc_value, tb)return Falsereturn True | 2 | 7 | 4 | 46 | 0 | 28 | 34 | 28 | self,exc_type,exc_value,tb | [] | Returns | {"Assign": 2, "Expr": 1, "If": 1, "Return": 2} | 1 | 7 | 1 | ["traceback.print_exception"] | 32 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.wheeltools_py.InWheel.__exit__", "_.content.gd... | The function (__exit__) defined within the public class called SimulateInput.The function start at line 28 and ends at 34. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [28.0], and this function return a value. It declare 1.0 function, It has 1.0 function cal... |
unifyai_unify | TestChatbotUniLLM | public | 0 | 0 | test_constructor | def test_constructor(self) -> None:client = Unify(endpoint="gpt-4o@openai",cache=True,)ChatBot(client) | 1 | 6 | 1 | 24 | 0 | 38 | 43 | 38 | self | [] | None | {"Assign": 1, "Expr": 1} | 2 | 6 | 2 | ["Unify", "ChatBot"] | 0 | [] | The function (test_constructor) defined within the public class called TestChatbotUniLLM.The function start at line 38 and ends at 43. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 ... |
unifyai_unify | TestChatbotUniLLM | public | 0 | 0 | test_simple_non_stream_chat_n_quit | def test_simple_non_stream_chat_n_quit(self):client = Unify(endpoint="gpt-4o@openai",cache=True,)chatbot = ChatBot(client)with SimulateInput():chatbot.run() | 1 | 8 | 1 | 34 | 0 | 45 | 52 | 45 | self | [] | None | {"Assign": 2, "Expr": 1, "With": 1} | 4 | 8 | 4 | ["Unify", "ChatBot", "SimulateInput", "chatbot.run"] | 0 | [] | The function (test_simple_non_stream_chat_n_quit) defined within the public class called TestChatbotUniLLM.The function start at line 45 and ends at 52. 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 4.0 functions... |
unifyai_unify | TestChatbotUniLLM | public | 0 | 0 | test_simple_stream_chat_n_quit | def test_simple_stream_chat_n_quit(self):client = Unify(endpoint="gpt-4o@openai",cache=True,stream=True,)chatbot = ChatBot(client)with SimulateInput():chatbot.run() | 1 | 9 | 1 | 38 | 0 | 55 | 63 | 55 | self | [] | None | {"Assign": 2, "Expr": 1, "With": 1} | 5 | 9 | 5 | ["Unify", "ChatBot", "SimulateInput", "chatbot.run", "pytest.mark.skip"] | 0 | [] | The function (test_simple_stream_chat_n_quit) defined within the public class called TestChatbotUniLLM.The function start at line 55 and ends at 63. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, an... |
unifyai_unify | TestChatbotUniLLM | public | 0 | 0 | test_constructor | def test_constructor(self) -> None:client = MultiUnify(endpoints=["gpt-4@openai", "gpt-4o@openai"],cache=True,)ChatBot(client) | 1 | 6 | 1 | 28 | 0 | 67 | 72 | 67 | self | [] | None | {"Assign": 1, "Expr": 1} | 2 | 6 | 2 | ["Unify", "ChatBot"] | 0 | [] | The function (test_constructor) defined within the public class called TestChatbotUniLLM.The function start at line 67 and ends at 72. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 ... |
unifyai_unify | TestChatbotUniLLM | public | 0 | 0 | test_simple_non_stream_chat_n_quit | def test_simple_non_stream_chat_n_quit(self):client = MultiUnify(endpoints=["gpt-4@openai", "gpt-4o@openai"],cache=True,)chatbot = ChatBot(client)with SimulateInput():chatbot.run() | 1 | 8 | 1 | 38 | 0 | 74 | 81 | 74 | self | [] | None | {"Assign": 2, "Expr": 1, "With": 1} | 4 | 8 | 4 | ["Unify", "ChatBot", "SimulateInput", "chatbot.run"] | 0 | [] | The function (test_simple_non_stream_chat_n_quit) defined within the public class called TestChatbotUniLLM.The function start at line 74 and ends at 81. 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 4.0 functions... |
unifyai_unify | public | public | 0 | 0 | test_openai_json_mode | def test_openai_json_mode() -> None:client = Unify(endpoint="gpt-4o@openai")result = client.generate(system_message="You are a helpful assistant designed to output JSON.",user_message="Who won the world series in 2020?",response_format={"type": "json_object"},)assert isinstance(result, str)result = json.loads(result)as... | 1 | 10 | 0 | 59 | 2 | 6 | 15 | 6 | ['client', 'result'] | None | {"Assign": 3} | 5 | 10 | 5 | ["Unify", "client.generate", "isinstance", "json.loads", "isinstance"] | 0 | [] | The function (test_openai_json_mode) defined within the public class called public.The function start at line 6 and ends at 15. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 functi... | |
unifyai_unify | public | public | 0 | 0 | test_anthropic_json_mode | def test_anthropic_json_mode() -> None:client = Unify(endpoint="claude-3-opus@anthropic")result = client.generate(system_message="You are a helpful assistant designed to output JSON.",user_message="Who won the world series in 2020?",)assert isinstance(result, str)result = json.loads(result)assert isinstance(result, dic... | 1 | 9 | 0 | 51 | 2 | 18 | 26 | 18 | ['client', 'result'] | None | {"Assign": 3} | 5 | 9 | 5 | ["Unify", "client.generate", "isinstance", "json.loads", "isinstance"] | 0 | [] | The function (test_anthropic_json_mode) defined within the public class called public.The function start at line 18 and ends at 26. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has 5.0 fun... | |
unifyai_unify | TestMultiUnify | public | 0 | 0 | test_constructor | def test_constructor(self) -> None:MultiUnify(endpoints=["llama-3-8b-chat@together-ai", "gpt-4o@openai"],cache=True,) | 1 | 5 | 1 | 22 | 0 | 6 | 10 | 6 | self | [] | None | {"Expr": 1} | 1 | 5 | 1 | ["MultiUnify"] | 0 | [] | The function (test_constructor) defined within the public class called TestMultiUnify.The function start at line 6 and ends at 10. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 functi... |
unifyai_unify | TestMultiUnify | public | 0 | 0 | test_add_endpoints | def test_add_endpoints(self):endpoints = ("llama-3-8b-chat@together-ai", "gpt-4o@openai")client = MultiUnify(endpoints=endpoints, cache=True)assert client.endpoints == endpointsassert tuple(client.clients.keys()) == endpointsclient.add_endpoints("claude-3.7-sonnet@anthropic")endpoints = ("llama-3-8b-chat@together-ai","... | 1 | 18 | 1 | 121 | 0 | 12 | 29 | 12 | self | [] | None | {"Assign": 3, "Expr": 3, "With": 1} | 11 | 18 | 11 | ["MultiUnify", "tuple", "client.clients.keys", "client.add_endpoints", "tuple", "client.clients.keys", "client.add_endpoints", "tuple", "client.clients.keys", "pytest.raises", "client.add_endpoints"] | 0 | [] | The function (test_add_endpoints) defined within the public class called TestMultiUnify.The function start at line 12 and ends at 29. 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 11.0 functions, and It has 11.... |
unifyai_unify | TestMultiUnify | public | 0 | 0 | test_remove_endpoints | def test_remove_endpoints(self):endpoints = ("llama-3-8b-chat@together-ai","gpt-4o@openai","claude-3.7-sonnet@anthropic",)client = MultiUnify(endpoints=endpoints, cache=True)assert client.endpoints == endpointsassert tuple(client.clients.keys()) == endpointsclient.remove_endpoints("claude-3.7-sonnet@anthropic")endpoint... | 1 | 18 | 1 | 121 | 0 | 31 | 48 | 31 | self | [] | None | {"Assign": 3, "Expr": 3, "With": 1} | 11 | 18 | 11 | ["MultiUnify", "tuple", "client.clients.keys", "client.remove_endpoints", "tuple", "client.clients.keys", "client.remove_endpoints", "tuple", "client.clients.keys", "pytest.raises", "client.remove_endpoints"] | 0 | [] | The function (test_remove_endpoints) defined within the public class called TestMultiUnify.The function start at line 31 and ends at 48. 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 11.0 functions, and It has ... |
unifyai_unify | TestMultiUnify | public | 0 | 0 | test_generate | def test_generate(self):endpoints = ("gpt-4o@openai","claude-3.7-sonnet@anthropic",)client = MultiUnify(endpoints=endpoints, cache=True)responses = client.generate("Hello, how it is going?")for endpoint, (response_endpoint, response) in zip(endpoints,responses.items(),):assert endpoint == response_endpointassert isinst... | 2 | 14 | 1 | 72 | 0 | 50 | 63 | 50 | self | [] | None | {"Assign": 3, "For": 1} | 6 | 14 | 6 | ["MultiUnify", "client.generate", "zip", "responses.items", "isinstance", "len"] | 0 | [] | The function (test_generate) defined within the public class called TestMultiUnify.The function start at line 50 and ends at 63. It contains 14 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 funct... |
unifyai_unify | TestMultiUnify | public | 0 | 0 | test_multi_message_histories | def test_multi_message_histories(self):endpoints = ("claude-3.7-sonnet@anthropic", "gpt-4o@openai")messages = {"claude-3.7-sonnet@anthropic": [{"role": "assistant", "content": "Let's talk about cats"},],"gpt-4o@openai": [{"role": "assistant", "content": "Let's talk about dogs"},],}animals = {"claude-3.7-sonnet@anthropi... | 2 | 25 | 1 | 132 | 0 | 65 | 89 | 65 | self | [] | None | {"Assign": 5, "For": 1} | 7 | 25 | 7 | ["MultiUnify", "client.generate", "zip", "responses.items", "isinstance", "len", "response.lower"] | 0 | [] | The function (test_multi_message_histories) defined within the public class called TestMultiUnify.The function start at line 65 and ends at 89. It contains 25 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 7.0 functions, and I... |
unifyai_unify | TestMultiUnify | public | 0 | 0 | test_setter_chaining | def test_setter_chaining(self):endpoints = ("llama-3-8b-chat@together-ai","gpt-4o@openai","claude-3.7-sonnet@anthropic",)client = MultiUnify(endpoints=endpoints, cache=True)client.add_endpoints(["gpt-4@openai", "gpt-4-turbo@openai"]).remove_endpoints("claude-3.7-sonnet@anthropic",)assert set(client.endpoints) == {"llam... | 1 | 16 | 1 | 61 | 0 | 91 | 106 | 91 | self | [] | None | {"Assign": 2, "Expr": 1} | 4 | 16 | 4 | ["MultiUnify", "remove_endpoints", "client.add_endpoints", "set"] | 0 | [] | The function (test_setter_chaining) defined within the public class called TestMultiUnify.The function start at line 91 and ends at 106. 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 4.0 functions, and It has 4... |
unifyai_unify | TestAsyncMultiUnify | public | 0 | 0 | test_async_generate | async def test_async_generate(self):endpoints = ("gpt-4o@openai","claude-3.7-sonnet@anthropic",)client = AsyncMultiUnify(endpoints=endpoints, cache=True)responses = await client.generate("Hello, how it is going?")for endpoint, (response_endpoint, response) in zip(endpoints,responses.items(),):assert endpoint == respons... | 2 | 14 | 1 | 73 | 0 | 111 | 124 | 111 | self | [] | None | {"Assign": 3, "For": 1} | 6 | 14 | 6 | ["AsyncMultiUnify", "client.generate", "zip", "responses.items", "isinstance", "len"] | 0 | [] | The function (test_async_generate) defined within the public class called TestAsyncMultiUnify.The function start at line 111 and ends at 124. It contains 14 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It ... |
unifyai_unify | TestStateful | public | 0 | 0 | test_stateful_sync_non_stream | def test_stateful_sync_non_stream(self):client = Unify(endpoint="gpt-4o@openai", cache=True, stateful=True)client.generate(user_message="hi")# non-streamassert len(client.messages) == 2# user + assistantassert client.messages[-1]["role"] == "assistant"assert isinstance(client.messages[-1]["content"], str) | 1 | 6 | 1 | 67 | 0 | 7 | 13 | 7 | self | [] | None | {"Assign": 1, "Expr": 1} | 4 | 7 | 4 | ["Unify", "client.generate", "len", "isinstance"] | 0 | [] | The function (test_stateful_sync_non_stream) defined within the public class called TestStateful.The function start at line 7 and ends at 13. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It h... |
unifyai_unify | TestStateful | public | 0 | 0 | test_stateful_sync_stream | def test_stateful_sync_stream(self):client = Unify(endpoint="gpt-4o@openai", cache=True, stateful=True)chunks = list(client.generate(user_message="hello", stream=True))assert all([isinstance(c, str) for c in chunks])assert len(client.messages) == 2# user + assistantassert isinstance(client.messages[-1]["content"], str) | 2 | 6 | 1 | 79 | 0 | 15 | 21 | 15 | self | [] | None | {"Assign": 2} | 7 | 7 | 7 | ["Unify", "list", "client.generate", "all", "isinstance", "len", "isinstance"] | 0 | [] | The function (test_stateful_sync_stream) defined within the public class called TestStateful.The function start at line 15 and ends at 21. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has ... |
unifyai_unify | TestStateful | public | 0 | 0 | test_stateless_sync_stream_clears_history | def test_stateless_sync_stream_clears_history(self):client = Unify(endpoint="gpt-4o@openai", stateful=False)list(client.generate(user_message="hello", stream=True))assert client.messages == []# history wiped | 1 | 4 | 1 | 39 | 0 | 23 | 27 | 23 | self | [] | None | {"Assign": 1, "Expr": 1} | 3 | 5 | 3 | ["Unify", "list", "client.generate"] | 0 | [] | The function (test_stateless_sync_stream_clears_history) defined within the public class called TestStateful.The function start at line 23 and ends at 27. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functio... |
unifyai_unify | TestStateful | public | 0 | 0 | test_stateful_async_non_stream | async def test_stateful_async_non_stream(self):client = AsyncUnify(endpoint="gpt-4o@openai", cache=True, stateful=True)await client.generate(user_message="hi")# non-streamassert len(client.messages) == 2# user + assistantassert isinstance(client.messages[-1]["content"], str) | 1 | 5 | 1 | 55 | 0 | 31 | 36 | 31 | self | [] | None | {"Assign": 1, "Expr": 1} | 4 | 6 | 4 | ["AsyncUnify", "client.generate", "len", "isinstance"] | 0 | [] | The function (test_stateful_async_non_stream) defined within the public class called TestStateful.The function start at line 31 and ends at 36. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It... |
unifyai_unify | TestStateful | public | 0 | 0 | test_stateful_async_stream | async def test_stateful_async_stream(self):client = AsyncUnify(endpoint="gpt-4o@openai", cache=True, stateful=True)stream = await client.generate(user_message="hello", stream=True)assert all([isinstance(c, str) async for c in stream])assert len(client.messages) == 2# user + assistantassert isinstance(client.messages[-1... | 2 | 6 | 1 | 78 | 0 | 39 | 45 | 39 | self | [] | None | {"Assign": 2} | 6 | 7 | 6 | ["AsyncUnify", "client.generate", "all", "isinstance", "len", "isinstance"] | 0 | [] | The function (test_stateful_async_stream) defined within the public class called TestStateful.The function start at line 39 and ends at 45. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has... |
unifyai_unify | public | public | 0 | 0 | test_with_logging | def test_with_logging() -> None:model_fn = lambda msg: "This is my response."model_fn = unify.with_logging(model_fn, endpoint="my_model")model_fn(msg="Hello?") | 1 | 4 | 0 | 30 | 1 | 8 | 11 | 8 | ['model_fn'] | None | {"Assign": 2, "Expr": 1} | 2 | 4 | 2 | ["unify.with_logging", "model_fn"] | 0 | [] | The function (test_with_logging) defined within the public class called public.The function start at line 8 and ends at 11. 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 has 2.0 functions c... | |
unifyai_unify | SimulateInput | public | 0 | 0 | __init__ | def __init__(self):self._message = "Hi, how can I help you?"self._true_input = None | 1 | 3 | 1 | 15 | 0 | 9 | 11 | 9 | self | [] | None | {"Assign": 2} | 0 | 3 | 0 | [] | 14,667 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.AllocationError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.ContentError.__init__", "_... | The function (__init__) defined within the public class called SimulateInput.The function start at line 9 and ends at 11. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 14667.0 functions calling this function which are... |
unifyai_unify | SimulateInput | public | 0 | 0 | _new_input | def _new_input(self, user_instructions):if user_instructions is not None:print(user_instructions)print(self._message)return self._message | 2 | 5 | 2 | 27 | 0 | 13 | 17 | 13 | self,user_instructions | [] | Returns | {"Expr": 2, "If": 1, "Return": 1} | 2 | 5 | 2 | ["print", "print"] | 0 | [] | The function (_new_input) defined within the public class called SimulateInput.The function start at line 13 and ends at 17. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [13.0], and this function return a value. It declares 2.0 functions, and It has 2.0 fun... |
unifyai_unify | SimulateInput | public | 0 | 0 | __enter__ | def __enter__(self):self._true_input = builtins.__dict__["input"]builtins.__dict__["input"] = self._new_input | 1 | 3 | 1 | 25 | 0 | 19 | 21 | 19 | self | [] | None | {"Assign": 2} | 0 | 3 | 0 | [] | 35 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.contexts_py.Functor.__enter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__enter__", "_.content.gdrive.M... | The function (__enter__) defined within the public class called SimulateInput.The function start at line 19 and ends at 21. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It has 35.0 functions calling this function which are ... |
unifyai_unify | SimulateInput | public | 0 | 0 | __exit__ | def __exit__(self, exc_type, exc_value, tb):builtins.__dict__["input"] = self._true_inputself._count = 0if exc_type is not None:traceback.print_exception(exc_type, exc_value, tb)return Falsereturn True | 2 | 7 | 4 | 46 | 0 | 23 | 29 | 23 | self,exc_type,exc_value,tb | [] | Returns | {"Assign": 2, "Expr": 1, "If": 1, "Return": 2} | 1 | 7 | 1 | ["traceback.print_exception"] | 32 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.wheeltools_py.InWheel.__exit__", "_.content.gd... | The function (__exit__) defined within the public class called SimulateInput.The function start at line 23 and ends at 29. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [23.0], and this function return a value. It declare 1.0 function, It has 1.0 function cal... |
unifyai_unify | public | public | 0 | 0 | test_user_input_client | def test_user_input_client():client = unify.Unify("user-input")with SimulateInput():response = client.generate("hello")assert isinstance(response, str)response = client.generate("hello", return_full_completion=True)assert isinstance(response, ChatCompletion) | 1 | 7 | 0 | 51 | 2 | 32 | 38 | 32 | ['client', 'response'] | None | {"Assign": 3, "With": 1} | 6 | 7 | 6 | ["unify.Unify", "SimulateInput", "client.generate", "isinstance", "client.generate", "isinstance"] | 0 | [] | The function (test_user_input_client) defined within the public class called public.The function start at line 32 and ends at 38. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 funct... | |
unifyai_unify | public | public | 0 | 0 | test_get_credits | def test_get_credits() -> None:creds = unify.get_credits()assert isinstance(creds, float) | 1 | 3 | 0 | 20 | 1 | 4 | 6 | 4 | ['creds'] | None | {"Assign": 1} | 2 | 3 | 2 | ["unify.get_credits", "isinstance"] | 0 | [] | The function (test_get_credits) defined within the public class called public.The function start at line 4 and ends at 6. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions cal... | |
unifyai_unify | CustomAPIKeyHandler | public | 0 | 0 | __init__ | def __init__(self, ky_name, ky_value, nw_name):self._key_name = ky_nameself._key_value = ky_valueself._new_name = nw_name | 1 | 4 | 4 | 26 | 0 | 6 | 9 | 6 | self,ky_name,ky_value,nw_name | [] | None | {"Assign": 3} | 0 | 4 | 0 | [] | 14,667 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.AllocationError.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15914487_netbox_community_pynetbox.pynetbox.core.query_py.ContentError.__init__", "_... | The function (__init__) defined within the public class called CustomAPIKeyHandler.The function start at line 6 and ends at 9. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [6.0] and does not return any value. It has 14667.0 functions calling this function wh... |
unifyai_unify | CustomAPIKeyHandler | public | 0 | 0 | _handle | def _handle(self):# should work even if list_custom_api_keys does notfor name in (self._key_name, self._new_name):try:unify.delete_custom_api_key(name)except:pass# should if other keys have wrongly been createdtry:custom_keys = unify.list_custom_api_keys()for dct in custom_keys:unify.delete_custom_api_key(dct["name"])e... | 5 | 12 | 1 | 55 | 0 | 11 | 24 | 11 | self | [] | None | {"Assign": 1, "Expr": 2, "For": 2, "Try": 2} | 3 | 14 | 3 | ["unify.delete_custom_api_key", "unify.list_custom_api_keys", "unify.delete_custom_api_key"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94634754_pytorch_executorch.exir.memory_planning_py._apply_algo_to_submodules"] | The function (_handle) defined within the public class called CustomAPIKeyHandler.The function start at line 11 and ends at 24. It contains 12 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 3.0 functions, It has 3.0 functions c... |
unifyai_unify | CustomAPIKeyHandler | public | 0 | 0 | __enter__ | def __enter__(self):self._handle() | 1 | 2 | 1 | 10 | 0 | 26 | 27 | 26 | self | [] | None | {"Expr": 1} | 1 | 2 | 1 | ["self._handle"] | 35 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3928915_donnemartin_gitsome.xonsh.contexts_py.Functor.__enter__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__enter__", "_.content.gdrive.M... | The function (__enter__) defined within the public class called CustomAPIKeyHandler.The function start at line 26 and ends at 27. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function cal... |
unifyai_unify | CustomAPIKeyHandler | public | 0 | 0 | __exit__ | def __exit__(self, exc_type, exc_val, exc_tb):self._handle() | 1 | 2 | 4 | 16 | 0 | 29 | 30 | 29 | self,exc_type,exc_val,exc_tb | [] | None | {"Expr": 1} | 1 | 2 | 1 | ["self._handle"] | 32 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.tmpdirs_py.InTemporaryDirectory.__exit__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3967063_matthew_brett_delocate.delocate.wheeltools_py.InWheel.__exit__", "_.content.gd... | The function (__exit__) defined within the public class called CustomAPIKeyHandler.The function start at line 29 and ends at 30. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [29.0] and does not return any value. It declare 1.0 function, It has 1.0 function c... |
unifyai_unify | public | public | 0 | 0 | _find_key | def _find_key(key_to_find, list_of_keys):for key in list_of_keys:if key["name"] == key_to_find:return Truereturn False | 3 | 5 | 2 | 24 | 0 | 33 | 37 | 33 | key_to_find,list_of_keys | [] | Returns | {"For": 1, "If": 1, "Return": 2} | 0 | 5 | 0 | [] | 0 | [] | The function (_find_key) defined within the public class called public.The function start at line 33 and ends at 37. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [33.0], and this function return a value.. |
unifyai_unify | public | public | 0 | 0 | test_create_custom_api_key | def test_create_custom_api_key():with handler:response = unify.create_custom_api_key(key_name, key_value)assert response == {"info": "API key created successfully!"} | 1 | 4 | 0 | 25 | 1 | 50 | 53 | 50 | ['response'] | None | {"Assign": 1, "With": 1} | 1 | 4 | 1 | ["unify.create_custom_api_key"] | 0 | [] | The function (test_create_custom_api_key) defined within the public class called public.The function start at line 50 and ends at 53. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 fun... | |
unifyai_unify | public | public | 0 | 0 | test_list_custom_api_keys | def test_list_custom_api_keys():with handler:custom_keys = unify.list_custom_api_keys()assert isinstance(custom_keys, list)assert len(custom_keys) == 0unify.create_custom_api_key(key_name, key_value)custom_keys = unify.list_custom_api_keys()assert isinstance(custom_keys, list)assert len(custom_keys) == 1assert custom_k... | 1 | 11 | 0 | 81 | 1 | 56 | 66 | 56 | ['custom_keys'] | None | {"Assign": 2, "Expr": 1, "With": 1} | 7 | 11 | 7 | ["unify.list_custom_api_keys", "isinstance", "len", "unify.create_custom_api_key", "unify.list_custom_api_keys", "isinstance", "len"] | 0 | [] | The function (test_list_custom_api_keys) defined within the public class called public.The function start at line 56 and ends at 66. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7.0 f... | |
unifyai_unify | public | public | 0 | 0 | test_get_custom_api_key | def test_get_custom_api_key():with handler:unify.create_custom_api_key(key_name, key_value)retrieved_key = unify.get_custom_api_key(key_name)assert isinstance(retrieved_key, dict)assert retrieved_key["name"] == key_nameassert retrieved_key["value"] == "*" * 4 + key_value | 1 | 7 | 0 | 48 | 1 | 69 | 75 | 69 | ['retrieved_key'] | None | {"Assign": 1, "Expr": 1, "With": 1} | 3 | 7 | 3 | ["unify.create_custom_api_key", "unify.get_custom_api_key", "isinstance"] | 0 | [] | The function (test_get_custom_api_key) defined within the public class called public.The function start at line 69 and ends at 75. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.0 func... | |
unifyai_unify | public | public | 0 | 0 | test_rename_custom_api_key | def test_rename_custom_api_key():with handler:unify.create_custom_api_key(key_name, key_value)custom_keys = unify.list_custom_api_keys()assert isinstance(custom_keys, list)assert len(custom_keys) == 1assert custom_keys[0]["name"] == key_nameunify.rename_custom_api_key(key_name, new_name)custom_keys = unify.list_custom_... | 1 | 12 | 0 | 85 | 1 | 78 | 89 | 78 | ['custom_keys'] | None | {"Assign": 2, "Expr": 2, "With": 1} | 8 | 12 | 8 | ["unify.create_custom_api_key", "unify.list_custom_api_keys", "isinstance", "len", "unify.rename_custom_api_key", "unify.list_custom_api_keys", "isinstance", "len"] | 0 | [] | The function (test_rename_custom_api_key) defined within the public class called public.The function start at line 78 and ends at 89. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 ... | |
unifyai_unify | public | public | 0 | 0 | test_delete_custom_api_key | def test_delete_custom_api_key():with handler:unify.create_custom_api_key(key_name, key_value)custom_keys = unify.list_custom_api_keys()assert isinstance(custom_keys, list)assert len(custom_keys) == 1assert custom_keys[0]["name"] == key_nameunify.delete_custom_api_key(key_name)custom_keys = unify.list_custom_api_keys()... | 1 | 11 | 0 | 73 | 1 | 92 | 102 | 92 | ['custom_keys'] | None | {"Assign": 2, "Expr": 2, "With": 1} | 8 | 11 | 8 | ["unify.create_custom_api_key", "unify.list_custom_api_keys", "isinstance", "len", "unify.delete_custom_api_key", "unify.list_custom_api_keys", "isinstance", "len"] | 0 | [] | The function (test_delete_custom_api_key) defined within the public class called public.The function start at line 92 and ends at 102. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.