MCPcopy Create free account
hub / github.com/DataArcTech/DataArc-SynData-Toolkit / generate_function

Function generate_function

verl/single_controller/ray/base.py:836–847  ·  view source on GitHub ↗
(name, key=key)

Source from the content-addressed store, hash-verified

834 if hasattr(method, MAGIC_ATTR):
835
836 def generate_function(name, key=key):
837 def func(self, *args, **kwargs):
838 # dispatch to the actual worker
839 return getattr(self.worker_dict[key], name)(*args, **kwargs)
840
841 async def async_func(self, *args, **kwargs):
842 # dispatch to the actual worker
843 return await getattr(self.worker_dict[key], name)(*args, **kwargs)
844
845 wrapper = async_func if inspect.iscoroutinefunction(method) else func # noqa: B023
846
847 return wrapper
848
849 func = generate_function(method_name)
850 # pass MAGIC_ATTR for outer worker group

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected