class_docstr: Implementation of heterogeneous graph structure in pgl
  
  This is a simple implementation of heterogeneous graph structure in pgl.
  
  Args:
      num_nodes: number of nodes in a heterogeneous graph
      edges: dict, every element in dict is a list of (u, v) tuples.
      node_types (optional): list of (u, node_type) tuples to specify the node type of every node
      node_feat (optional): a dict of numpy array as node features
      edge_feat (optional): a dict of dict as edge features for every edge type
  
  Examples:
      .. code-block:: python
  
          import numpy as np
          num_nodes = 4
          node_types = [(0, 'user'), (1, 'item'), (2, 'item'), (3, 'user')]
          edges = {
              'edges_type1': [(0,1), (3,2)],
              'edges_type2': [(1,2), (3,1)],
          }
          node_feat = {'feature': np.random.randn(4, 16)}
          edges_feat = {
              'edges_type1': {'h': np.random.randn(2, 16)},
              'edges_type2': {'h': np.random.randn(2, 16)},
          }
  
          g = heter_graph.HeterGraph(
                          num_nodes=num_nodes,
                          edges=edges,
                          node_types=node_types,
                          node_feat=node_feat,
                          edge_feat=edges_feat)
class_docstr_tok: ["Implementation","of","heterogeneous","graph","structure","in","pgl","This","is","a","simple","implementation","of","heterogeneous","graph","structure","in","pgl",".","Args",":","num_nodes",":","number","of","nodes","in","a","heterogeneous","graph","edges",":","dict",",","every","element","in","dict","is","a","list","of","(","u",",","v",")","tuples",".","node_types","(","optional",")",":","list","of","(","u",",","node_type",")","tuples","to","specify","the","node","type","of","every","node","node_feat","(","optional",")",":","a","dict","of","numpy","array","as","node","features","edge_feat","(","optional",")",":","a","dict","of","dict","as","edge","features","for","every","edge","type","Examples",":","..","code-block",":",":","python","import","numpy","as","np","num_nodes","=","4","node_types","=","[","(","0",",","'user","'",")",",","(","1",",","'item","'",")",",","(","2",",","'item","'",")",",","(","3",",","'user","'",")","]","edges","=","{","'edges_type1","'",":","[","(","0,1",")",",","(","3,2",")","]",",","'edges_type2","'",":","[","(","1,2",")",",","(","3,1",")","]",",","}","node_feat","=","{","'feature","'",":","np.random.randn","(","4",",","16",")","}","edges_feat","=","{","'edges_type1","'",":","{","'","h","'",":","np.random.randn","(","2",",","16",")","}",",","'edges_type2","'",":","{","'","h","'",":","np.random.randn","(","2",",","16",")","}",",","}","g","=","heter_graph.HeterGraph","(","num_nodes=num_nodes",",","edges=edges",",","node_types=node_types",",","node_feat=node_feat",",","edge_feat=edges_feat",")"]
docstr: Sample successors of given nodes with the specified edge_type.
  
  Args:
      edge_type: The specified edge_type.
  
      nodes: Given nodes whose successors will be sampled.
  
      max_degree: The max sampled successors for each nodes.
  
      return_eids: Whether to return the corresponding eids.
  
  Return:
  
      Return a list of numpy.ndarray and each numpy.ndarray represent a list
      of sampled successor ids for given nodes with specified edge type. 
      If :code:`return_eids=True`, there will be an additional list of 
      numpy.ndarray and each numpy.ndarray represent a list of eids that 
      connected nodes to their successors.
docstr_tok: ["Sample","successors","of","given","nodes","with","the","specified","edge_type",".","Args",":","edge_type",":","The","specified","edge_type",".","nodes",":","Given","nodes","whose","successors","will","be","sampled",".","max_degree",":","The","max","sampled","successors","for","each","nodes",".","return_eids",":","Whether","to","return","the","corresponding","eids",".","Return",":","Return","a","list","of","numpy.ndarray","and","each","numpy.ndarray","represent","a","list","of","sampled","successor","ids","for","given","nodes","with","specified","edge","type",".","If",":","code",":","`","return_eids=True","`",",","there","will","be","an","additional","list","of","numpy.ndarray","and","each","numpy.ndarray","represent","a","list","of","eids","that","connected","nodes","to","their","successors","."]
code: def sample_successor(
      self,
      edge_type,
      nodes,
      max_degree,
      return_eids=False,
      shuffle=False,
  ):
      """Sample successors of given nodes with the specified edge_type.
  
      Args:
          edge_type: The specified edge_type.
  
          nodes: Given nodes whose successors will be sampled.
  
          max_degree: The max sampled successors for each nodes.
  
          return_eids: Whether to return the corresponding eids.
  
      Return:
  
          Return a list of numpy.ndarray and each numpy.ndarray represent a list
          of sampled successor ids for given nodes with specified edge type.
          If :code:`return_eids=True`, there will be an additional list of
          numpy.ndarray and each numpy.ndarray represent a list of eids that
          connected nodes to their successors.
      """
      return self._multi_graph[edge_type].sample_successor(
          nodes=nodes,
          max_degree=max_degree,
          return_eids=return_eids,
          shuffle=shuffle,
      )
  
imports: import os
  import time
  import numpy
  import pickle
  import time
  import pgl.graph_kernel
  from pgl.graph import Graph, MemmapGraph
label_desc: Use image node_id 15 for calling the HeterGraph obj's underlying member method code with example usage: obj.sample_successor(edge_type, nodes, max_degree, return_eids, shuffle) and returns: self