class_docstr: View for graph nodes at at high level.
class_docstr_tok: ["View","for","graph","nodes","at","at","high","level","."]
docstr: Get a number of nodes and their corresponding data.
  
  Parameters
  ----------
  node_idx: int or slice
      The index of nodes to be accessed.
  
  Returns
  -------
  NodeRepr
      A collection of the corresponding data.
docstr_tok: ["Get","a","number","of","nodes","and","their","corresponding","data",".","Parameters","--","--","--","--","--","node_idx",":","int","or","slice","The","index","of","nodes","to","be","accessed",".","Returns","--","--","--","-","NodeRepr","A","collection","of","the","corresponding","data","."]
code: def __getitem__(self, node_idx: Union[int, slice]) -> NodeRepr:
      """
      Get a number of nodes and their corresponding data.
  
      Parameters
      ----------
      node_idx: int or slice
          The index of nodes to be accessed.
  
      Returns
      -------
      NodeRepr
          A collection of the corresponding data.
      """
      # consistency check
      # 1. type check
      if not (isinstance(node_idx, int) or isinstance(node_idx, slice)):
          raise TypeError("Only int and slice are supported currently.")
      # 2. boundary check
      if isinstance(node_idx, slice):
          node_idx_list = slice_to_list(
              node_idx, self._graph.get_node_num()
          )
          for idx in node_idx_list:
              if not (idx < self._graph.get_node_num()):
                  raise ValueError(
                      "Node {} does not exist in the graph.".format(idx)
                  )
      else:
          if not (node_idx < self._graph.get_node_num()):
              raise ValueError(
                  "Node {} does not exist in the graph.".format(
                      node_idx
                  )
              )
  
      return NodeRepr(
          features=NodeFeatView(self._graph, node_idx),
          attributes=NodeAttrView(self._graph, node_idx),
      )
  
imports: from collections import namedtuple
  from typing import Any, List, Union
  import torch
  from .utils import slice_to_list
label_desc: Use image node_id 2 for calling the NodeView obj's underlying member method code with example usage: obj.__getitem__(node_idx) and returns: NodeRepr