File size: 2,657 Bytes
d46fe38 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | {
"function_name": "simult_search",
"file_path": "src/helpers/dependent_cp/simult.py",
"function_calls": [
{
"function_call_name": "to_valid_array",
"functionality": "Converts the input dependency graph to a valid list-of-lists adjacency matrix, handling both list and string input representations.",
"input": "question[\"dep_graph\"]",
"output": "adjacency matrix (list[list[int]])",
"location_or_namespace": "src/helpers/dependent_cp/simult.py"
},
{
"function_call_name": "topological_sort",
"functionality": "Performs a topological sort on the directed acyclic graph (adjacency matrix), returning an ordering of nodes such that all dependencies of a node precede it.",
"input": "adj_list",
"output": "top_order (list[int])",
"location_or_namespace": "src/helpers/dependent_cp/simult.py"
},
{
"function_call_name": "risk_score",
"functionality": "Calculates a risk score for each node/claim based on its frequency score and, optionally, descendant risk information using a provided beta parameter.",
"input": "question, top_order, beta",
"output": "node_scores (dict[int, float])",
"location_or_namespace": "src/helpers/dependent_cp/simult.py"
},
{
"function_call_name": "sort",
"functionality": "Sorts a list in place in ascending order.",
"input": "None (method called as threshes.sort())",
"output": "None (threshes sorted in place)",
"location_or_namespace": "builtins"
},
{
"function_call_name": "enumerate",
"functionality": "Returns an iterator of pairs (index, value) for items in an iterable.",
"input": "top_order",
"output": "iterator of (int, element)",
"location_or_namespace": "builtins"
},
{
"function_call_name": "range",
"functionality": "Creates an iterable sequence of integers from 0 up to but not including a given value.",
"input": "len(node_scores) or len(question['claims']) or len(adj_list)",
"output": "iterator of int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "pop",
"functionality": "Removes and returns the item at the given position in the list (index 0 in this usage).",
"input": "0 (index of item to remove from candidates)",
"output": "node (int)",
"location_or_namespace": "builtins"
},
{
"function_call_name": "append",
"functionality": "Adds an item to the end of the list.",
"input": "node (int) or element (int or list)",
"output": "None",
"location_or_namespace": "builtins"
}
]
}
|