code: def preprocess_nxgraph(graph):
      node2idx = {}
      idx2node = []
      node_size = 0
      for node in graph.nodes():
          node2idx[node] = node_size
          idx2node.append(node)
          node_size += 1
      return idx2node, node2idx
  
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess_nxgraph(graph) and returns: idx2node,  node2idx