code: def main() -> None:
      parser = argparse.ArgumentParser(description="ONNX net drawer")
      parser.add_argument(
          "--input",
          type=str,
          required=True,
          help="The input protobuf file.",
      )
      parser.add_argument(
          "--output",
          type=str,
          required=True,
          help="The output protobuf file.",
      )
      parser.add_argument(
          "--rankdir",
          type=str,
          default="LR",
          help="The rank direction of the pydot graph.",
      )
      parser.add_argument(
          "--embed_docstring",
          action="store_true",
          help="Embed docstring as javascript alert. Useful for SVG format.",
      )
      args = parser.parse_args()
      model = ModelProto()
      with open(args.input, "rb") as fid:
          content = fid.read()
          model.ParseFromString(content)
      pydot_graph = GetPydotGraph(
          model.graph,
          name=model.graph.name,
          rankdir=args.rankdir,
          node_producer=GetOpNodeProducer(
              embed_docstring=args.embed_docstring, **OP_STYLE
          ),
      )
      pydot_graph.write_dot(args.output)
  
file_path: onnx/onnx/tools/net_drawer.py
imports: import argparse
  import json
  from collections import defaultdict
  from typing import Any, Callable, Dict, Optional
  import pydot
  from onnx import GraphProto, ModelProto, NodeProto
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types