MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / wrapped

Function wrapped

semantic_sam/utils/config.py:55–70  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

53
54 @functools.wraps(init_func)
55 def wrapped(self, *args, **kwargs):
56 try:
57 from_config_func = type(self).from_config
58 except AttributeError as e:
59 raise AttributeError(
60 "Class with @configurable must have a 'from_config' classmethod."
61 ) from e
62 if not inspect.ismethod(from_config_func):
63 raise TypeError("Class with @configurable must have a 'from_config' classmethod.")
64
65 # import ipdb; ipdb.set_trace()
66 if _called_with_cfg(*args, **kwargs):
67 explicit_args = _get_args_from_config(from_config_func, *args, **kwargs)
68 init_func(self, **explicit_args)
69 else:
70 init_func(self, *args, **kwargs)
71
72 return wrapped
73

Callers

nothing calls this directly

Calls 2

_called_with_cfgFunction · 0.85
_get_args_from_configFunction · 0.85

Tested by

no test coverage detected