Files
OpenHands/openhands/runtime/plugins/agent_skills/utils/dependency.py
2025-05-06 13:51:06 -04:00

12 lines
366 B
Python

from types import ModuleType
def import_functions(
module: ModuleType, function_names: list[str], target_globals: dict[str, object]
) -> None:
for name in function_names:
if hasattr(module, name):
target_globals[name] = getattr(module, name)
else:
raise ValueError(f'Function {name} not found in {module.__name__}')