code: def flat_node_and_edge(nodes, eids, weights=None):
      """flatten the sub-lists to one list"""
      nodes = list(set(traverse(nodes)))
      eids = list(traverse(eids))
      if weights is not None:
          weights = list(traverse(weights))
      return nodes, eids, weights
  
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 2 for calling a global function with example usage: flat_node_and_edge(nodes, eids, weights) and returns: nodes,  eids,  weights