class_docstr: A NodeView class to act as G.nodes for a DGLGraph.
class_docstr_tok: ["A","NodeView","class","to","act","as","G.nodes","for","a","DGLGraph","."]
code: def __getitem__(self, key):
      if isinstance(key, slice):
          # slice
          if not (
              key.start is None
              and key.stop is None
              and key.step is None
          ):
              raise DGLError(
                  'Currently only full slice ":" is supported'
              )
          nodes = ALL
          ntype = None
      elif isinstance(key, tuple):
          nodes, ntype = key
      elif key is None or isinstance(key, str):
          nodes = ALL
          ntype = key
      else:
          nodes = key
          ntype = None
      ntid = self._typeid_getter(ntype)
      return NodeSpace(
          data=HeteroNodeDataView(self._graph, ntype, ntid, nodes)
      )
  
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 2 for calling the HeteroNodeView obj's underlying member method code with example usage: obj.__getitem__(key) and returns: NodeSpace