code: def traverse_graph(graph, prefix=""):
      content = []
      indent = prefix + "  "
      graphs = []
      num_nodes = 0
      for node in graph.node:
          pn, gs = onnx.helper.printable_node(
              node, indent, subgraphs=True
          )
          assert isinstance(gs, list)
          content.append(pn)
          graphs.extend(gs)
          num_nodes += 1
      for g in graphs:
          g_count, g_str = traverse_graph(g)
          content.append("\n" + g_str)
          num_nodes += g_count
      return num_nodes, "\n".join(content)
  
imports: import argparse
  import warnings
  import onnx
  from onnx import optimizer
label_desc: Use image node_id 1 for calling a global function with example usage: traverse_graph(graph, prefix) and returns: num_nodes,  str