class_docstr: The data view class when G.ndata[ntype] is called.
class_docstr_tok: ["The","data","view","class","when","G.ndata","[","ntype","]","is","called","."]
code: def _transpose(self, as_dict=False):
      if isinstance(self._ntype, list):
          ret = defaultdict(dict)
          for i, ntype in enumerate(self._ntype):
              data = self._graph._get_n_repr(self._ntid[i], self._nodes)
              for key in self._graph._node_frames[self._ntid[i]]:
                  ret[key][ntype] = data[key]
      else:
          ret = self._graph._get_n_repr(self._ntid, self._nodes)
          if as_dict:
              ret = {
                  key: ret[key]
                  for key in self._graph._node_frames[self._ntid]
              }
      return ret
  
imports: from __future__ import absolute_import
  from collections import defaultdict, namedtuple
  from collections.abc import MutableMapping
  from .None import backend
  from .base import ALL, DGLError
  from .frame import LazyFeature
label_desc: Use image node_id 5 for calling the HeteroNodeDataView obj's underlying member method code with example usage: obj._transpose(as_dict) and returns: ret