MCPcopy
hub / github.com/huggingface/smolagents / evaluate_listcomp

Function evaluate_listcomp

src/smolagents/local_python_executor.py:1099–1115  ·  view source on GitHub ↗
(
    listcomp: ast.ListComp,
    state: dict[str, Any],
    static_tools: dict[str, Callable],
    custom_tools: dict[str, Callable],
    authorized_imports: list[str],
)

Source from the content-addressed store, hash-verified

1097
1098
1099def evaluate_listcomp(
1100 listcomp: ast.ListComp,
1101 state: dict[str, Any],
1102 static_tools: dict[str, Callable],
1103 custom_tools: dict[str, Callable],
1104 authorized_imports: list[str],
1105) -> list[Any]:
1106 return list(
1107 _evaluate_comprehensions(
1108 listcomp.generators,
1109 lambda comp_state: evaluate_ast(listcomp.elt, comp_state, static_tools, custom_tools, authorized_imports),
1110 state,
1111 static_tools,
1112 custom_tools,
1113 authorized_imports,
1114 )
1115 )
1116
1117
1118def evaluate_setcomp(

Callers 1

evaluate_astFunction · 0.85

Calls 2

_evaluate_comprehensionsFunction · 0.85
evaluate_astFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…