code: def create_graph(
      predicted_ids, parent_ids, scores, normalized_scores, include_pad
  ):
      seq_length = len(predicted_ids)
      graph = nx.DiGraph()
      for level in range(seq_length):
          names = [pred for pred in predicted_ids[level]]
          _add_graph_level(
              graph,
              level + 1,
              parent_ids[level],
              names,
              scores[level],
              normalized_scores[level],
              include_pad,
          )
      graph.node[(0, 0)]["name"] = "START"
      return graph
  
file_path: sockeye/sockeye_contrib/vistools/generate_graphs.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import argparse
  import os
  import json
  import shutil
  from string import Template
  import networkx
  from networkx.readwrite import json_graph
label_desc: Use image node_id 2 for calling a global function with example usage: create_graph(predicted_ids, parent_ids, scores, normalized_scores, include_pad) and returns: graph