code: def write_dot(G, path):
      """Write NetworkX graph G to Graphviz dot format on path.
  
      Path can be a string or a file handle.
      """
      P = to_pydot(G)
      path.write(P.to_string())
      return
  
file_path: networkx/networkx/drawing/nx_pydot.py
imports: from locale import getpreferredencoding
  import networkx
  from networkx.utils import open_file
label_desc: Use image node_id 1 for calling a global function with example usage: write_dot(G, path) without return types