MCPcopy
hub / github.com/PaddlePaddle/PARL / is_implemented_in_notebook

Function is_implemented_in_notebook

parl/remote/remote_class_serialization.py:52–64  ·  view source on GitHub ↗

Check if the remote class is implemented in the environments like notebook(e.g., ipython, notebook). Args: cls: class

(cls)

Source from the content-addressed store, hash-verified

50
51
52def is_implemented_in_notebook(cls):
53 """Check if the remote class is implemented in the environments like notebook(e.g., ipython, notebook).
54
55 Args:
56 cls: class
57 """
58 assert inspect.isclass(cls)
59
60 if hasattr(cls, '__module__'):
61 cls_module = sys.modules.get(cls.__module__)
62 if getattr(cls_module, '__file__', None):
63 return False
64 return True
65
66
67def locate_remote_file(module_path):

Callers 1

dump_remote_classFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected