code: def graph_alias_sample_table(graph, edge_weight_name):
      """Build alias sample table for weighted deepwalk.
      Args:
          graph: The input graph
          edge_weight_name: The name of edge weight in edge_feat.
  
      Return:
          Alias sample tables for each nodes.
      """
      edge_weight = graph.edge_feat[edge_weight_name]
      _, eids_array = graph.successor(return_eids=True)
      alias_array, events_array = [], []
      for eids in eids_array:
          probs = edge_weight[eids]
          probs /= np.sum(probs)
          alias, events = graph_kernel.alias_sample_build_table(probs)
          alias_array.append(alias), events_array.append(events)
      alias_array, events_array = np.array(alias_array), np.array(
          events_array
      )
      return alias_array, events_array
  
file_path: PGL/legacy/pgl/sample.py
imports: import time
  import copy
  import numpy
  import pgl
  from pgl.utils.logger import log
  from pgl import graph_kernel
label_desc: Use image node_id 6 for calling a global function with example usage: graph_alias_sample_table(graph, edge_weight_name) and returns: alias_array,  events_array