code: def create_pydot_graph(
      op_nodes_desc,
      data_nodes,
      param_nodes,
      edges,
      rankdir="TB",
      styles=None,
  ):
      """Low-level API to create a PyDot graph (dot formatted)."""
      pydot_graph = pydot.Dot(
          "Net", graph_type="digraph", rankdir=rankdir
      )
  
      op_node_style = {
          "shape": "record",
          "fillcolor": "#6495ED",
          "style": "rounded, filled",
      }
  
      for op_node in op_nodes_desc:
          style = op_node_style
          # Check if we should override the style of this node.
          if styles is not None and op_node[0] in styles:
              style = styles[op_node[0]]
          pydot_graph.add_node(
              pydot.Node(op_node[0], **style, label="\n".join(op_node))
          )
  
      for data_node in data_nodes:
          pydot_graph.add_node(
              pydot.Node(data_node[0], label="\n".join(data_node[1:]))
          )
  
      node_style = {
          "shape": "oval",
          "fillcolor": "gray",
          "style": "rounded, filled",
      }
  
      if param_nodes is not None:
          for param_node in param_nodes:
              pydot_graph.add_node(
                  pydot.Node(
                      param_node[0],
                      **node_style,
                      label="\n".join(param_node[1:]),
                  )
              )
  
      for edge in edges:
          pydot_graph.add_edge(pydot.Edge(edge[0], edge[1]))
  
      return pydot_graph
  
file_path: tensorwatch/tensorwatch/model_graph/hiddenlayer/pytorch_draw_model.py
imports: import pydot
  from .summary_graph import SummaryGraph
  from .None import distiller
  import torch
  import collections.abc
  import os
label_desc: Use image node_id 5 for calling a global function with example usage: create_pydot_graph(op_nodes_desc, data_nodes, param_nodes, edges, rankdir, styles) and returns: pydot_graph