code: def d3write(fct, path, *args, **kwargs):
      """Convert PyTensor graph to pydot graph and write to dot file.
  
      Parameters
      ----------
      fct : pytensor.compile.function.types.Function
          A compiled PyTensor function, variable, apply or a list of variables.
      path: str
          Path to output file
  
      Notes
      -----
      This function accepts extra parameters which will be forwarded to
      :class:`pytensor.d3viz.formatting.PyDotFormatter`.
  
      """
  
      formatter = PyDotFormatter(*args, **kwargs)
      graph = formatter(fct)
      graph.write_dot(path)
  
file_path: pytensor/pytensor/d3viz/d3viz.py
imports: import json
  import os
  import shutil
  from pytensor.d3viz.formatting import PyDotFormatter
label_desc: Use image node_id 4 for calling a global function with example usage: d3write(fct, path) without return types