MCPcopy Create free account
hub / github.com/DIVE128/DMVSNet / wrapper

Function wrapper

tools.py:62–70  ·  view source on GitHub ↗
(vars)

Source from the content-addressed store, hash-verified

60# convert a function into recursive style to handle nested dict/list/tuple variables
61def make_recursive_func(func):
62 def wrapper(vars):
63 if isinstance(vars, list):
64 return [wrapper(x) for x in vars]
65 elif isinstance(vars, tuple):
66 return tuple([wrapper(x) for x in vars])
67 elif isinstance(vars, dict):
68 return {k: wrapper(v) for k, v in vars.items()}
69 else:
70 return func(vars)
71
72 return wrapper
73

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected