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

Function evaluate_dictcomp

src/smolagents/local_python_executor.py:1137–1156  ·  view source on GitHub ↗
(
    dictcomp: ast.DictComp,
    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

1135
1136
1137def evaluate_dictcomp(
1138 dictcomp: ast.DictComp,
1139 state: dict[str, Any],
1140 static_tools: dict[str, Callable],
1141 custom_tools: dict[str, Callable],
1142 authorized_imports: list[str],
1143) -> dict[Any, Any]:
1144 return dict(
1145 _evaluate_comprehensions(
1146 dictcomp.generators,
1147 lambda comp_state: (
1148 evaluate_ast(dictcomp.key, comp_state, static_tools, custom_tools, authorized_imports),
1149 evaluate_ast(dictcomp.value, comp_state, static_tools, custom_tools, authorized_imports),
1150 ),
1151 state,
1152 static_tools,
1153 custom_tools,
1154 authorized_imports,
1155 )
1156 )
1157
1158
1159def evaluate_try(

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…