code: def alias_sample(accept, alias):
      """
  
      :param accept:
      :param alias:
      :return: sample index
      """
      N = len(accept)
      i = int(np.random.random() * N)
      r = np.random.random()
      if r < accept[i]:
          return i
      else:
          return alias[i]
  
label_desc: Use image node_id 2 for calling a global function with example usage: alias_sample(accept, alias) and returns: i, alias