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

Method __getitem__

python/dgl/view.py:69–80  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

67 self._nodes = nodes
68
69 def __getitem__(self, key):
70 if isinstance(self._ntype, list):
71 ret = {}
72 for (i, ntype) in enumerate(self._ntype):
73 value = self._graph._get_n_repr(self._ntid[i], self._nodes).get(
74 key, None
75 )
76 if value is not None:
77 ret[ntype] = value
78 return ret
79 else:
80 return self._graph._get_n_repr(self._ntid, self._nodes)[key]
81
82 def __setitem__(self, key, val):
83 if isinstance(val, LazyFeature):

Callers

nothing calls this directly

Calls 2

_get_n_reprMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected