class_docstr: Implementation of graph structure in pgl.
  
  This is a simple implementation of graph structure in pgl.
  
  Args:
      num_nodes: number of nodes in a graph
      edges: list of (u, v) tuples
      node_feat (optional): a dict of numpy array as node features
      edge_feat (optional): a dict of numpy array as edge features (should
                              have consistent order with edges)
  
  Examples:
  
      .. code-block:: python
  
          import numpy as np
          num_nodes = 5
          edges = [ (0, 1), (1, 2), (3, 4)]
          feature = np.random.randn(5, 100)
          edge_feature = np.random.randn(3, 100)
          graph = Graph(num_nodes=num_nodes,
                      edges=edges,
                      node_feat={
                          "feature": feature
                      },
                      edge_feat={
                          "edge_feature": edge_feature
                      })
class_docstr_tok: ["Implementation","of","graph","structure","in","pgl",".","This","is","a","simple","implementation","of","graph","structure","in","pgl",".","Args",":","num_nodes",":","number","of","nodes","in","a","graph","edges",":","list","of","(","u",",","v",")","tuples","node_feat","(","optional",")",":","a","dict","of","numpy","array","as","node","features","edge_feat","(","optional",")",":","a","dict","of","numpy","array","as","edge","features","(","should","have","consistent","order","with","edges",")","Examples",":","..","code-block",":",":","python","import","numpy","as","np","num_nodes","=","5","edges","=","[","(","0",",","1",")",",","(","1",",","2",")",",","(","3",",","4",")","]","feature","=","np.random.randn","(","5",",","100",")","edge_feature","=","np.random.randn","(","3",",","100",")","graph","=","Graph","(","num_nodes=num_nodes",",","edges=edges",",","node_feat=","{","``","feature","''",":","feature","}",",","edge_feat=","{","``","edge_feature","''",":","edge_feature","}",")"]
docstr: Return the number of nodes.
          
code: def num_nodes(self):
      """Return the number of nodes."""
      return self._num_nodes
  
imports: import os
  import numpy
  import pickle
  import time
  import pgl.graph_kernel
  from collections import defaultdict
label_desc: Use image node_id 8 for calling the Graph obj's underlying member method code with example usage: obj.num_nodes() and returns: self