MCPcopy
hub / github.com/dmlc/dgl / wrapper

Function wrapper

python/dgl/utils/internal.py:524–533  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

522 def _creator(func):
523 @wraps(func)
524 def wrapper(self, *args, **kwargs):
525 dic = getattr(self, cache)
526 key = "%s-%s-%s" % (
527 prefix,
528 "-".join([str(a) for a in args]),
529 "-".join([str(k) + ":" + str(v) for k, v in kwargs.items()]),
530 )
531 if key not in dic:
532 dic[key] = func(self, *args, **kwargs)
533 return dic[key]
534
535 return wrapper
536

Callers 1

_find_and_wrap_parentFunction · 0.50

Calls 3

funcFunction · 0.50
joinMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected