class_docstr: Create `pydot` graph object from PyTensor function.
  
  Parameters
  ----------
  compact : bool
      if True, will remove intermediate variables without name.
  
  Attributes
  ----------
  node_colors : dict
      Color table of node types.
  apply_colors : dict
      Color table of apply nodes.
  shapes : dict
      Shape table of node types.
class_docstr_tok: ["Create","`","pydot","`","graph","object","from","PyTensor","function",".","Parameters","--","--","--","--","--","compact",":","bool","if","True",",","will","remove","intermediate","variables","without","name",".","Attributes","--","--","--","--","--","node_colors",":","dict","Color","table","of","node","types",".","apply_colors",":","dict","Color","table","of","apply","nodes",".","shapes",":","dict","Shape","table","of","node","types","."]
docstr: Construct PyDotFormatter object.
docstr_tok: ["Construct","PyDotFormatter","object","."]
code: def __init__(self, compact=True):
      """Construct PyDotFormatter object."""
      if not pydot_imported:
          raise ImportError(
              "Failed to import pydot. " + pydot_imported_msg
          )
  
      self.compact = compact
      self.node_colors = {
          "input": "limegreen",
          "constant_input": "SpringGreen",
          "shared_input": "YellowGreen",
          "output": "dodgerblue",
          "unused": "lightgrey",
      }
      self.apply_colors = {
          "Scan": "yellow",
          "Shape": "cyan",
          "IfElse": "magenta",
          "Elemwise": "#FFAABB",  # dark pink
          "Subtensor": "#FFAAFF",  # purple
          "Alloc": "#FFAA22",
      }  # orange
      self.shapes = {
          "input": "box",
          "output": "box",
          "apply": "ellipse",
      }
      self.__node_prefix = "n"
  
imports: import os
  from functools import reduce
  import numpy
  import pytensor
  from pytensor.compile import Function, builders
  from pytensor.graph.basic import Apply, Constant, Variable, graph_inputs
  from pytensor.graph.fg import FunctionGraph
  from pytensor.printing import pydot_imported, pydot_imported_msg
label_desc: Use image node_id 1 to create a new PyDotFormatter object  with example: obj = PyDotFormatter(compact)