code: def alias_draw(J, q):
      """
      Draw sample from a non-uniform discrete distribution using alias sampling.
      """
      K = len(J)
  
      kk = int(np.floor(np.random.rand() * K))
      if np.random.rand() < q[kk]:
          return kk
      else:
          return J[kk]
  
file_path: OpenNE/src/openne/walker.py
imports: from __future__ import print_function
  import random
  import numpy
  import multiprocessing
label_desc: Use image node_id 3 for calling a global function with example usage: alias_draw(J, q) and returns: kk, J