code: def read_dot(path):
      """Returns a NetworkX graph from a dot file on path.
  
      Parameters
      ----------
      path : file or string
         File name or file handle to read.
      """
      try:
          import pygraphviz
      except ImportError as err:
          raise ImportError(
              "read_dot() requires pygraphviz http://pygraphviz.github.io/"
          ) from err
      A = pygraphviz.AGraph(file=path)
      gr = from_agraph(A)
      A.clear()
      return gr
  
file_path: networkx/networkx/drawing/nx_agraph.py
imports: import os
  import tempfile
  import networkx
label_desc: Use image node_id 4 for calling a global function with example usage: read_dot(path) and returns: gr