code: def export_graph(
      graph_in,
      base_dir=None,
      show=False,
      use_execgraph=False,
      show_connectinfo=False,
      dotfilename="graph.dot",
      format="png",
      simple_form=True,
  ):
      """Displays the graph layout of the pipeline
  
      This function requires that pygraphviz and matplotlib are available on
      the system.
  
      Parameters
      ----------
  
      show : boolean
      Indicate whether to generate pygraphviz output fromn
      networkx. default [False]
  
      use_execgraph : boolean
      Indicates whether to use the specification graph or the
      execution graph. default [False]
  
      show_connectioninfo : boolean
      Indicates whether to show the edge data on the graph. This
      makes the graph rather cluttered. default [False]
      """
      import networkx as nx
  
      graph = deepcopy(graph_in)
      if use_execgraph:
          graph = generate_expanded_graph(graph)
          logger.debug("using execgraph")
      else:
          logger.debug("using input graph")
      if base_dir is None:
          base_dir = os.getcwd()
  
      os.makedirs(base_dir, exist_ok=True)
      out_dot = fname_presuffix(
          dotfilename,
          suffix="_detailed.dot",
          use_ext=False,
          newpath=base_dir,
      )
      _write_detailed_dot(graph, out_dot)
  
      # Convert .dot if format != 'dot'
      outfname, res = _run_dot(out_dot, format_ext=format)
      if res is not None and res.runtime.returncode:
          logger.warning("dot2png: %s", res.runtime.stderr)
  
      pklgraph = _create_dot_graph(graph, show_connectinfo, simple_form)
      simple_dot = fname_presuffix(
          dotfilename, suffix=".dot", use_ext=False, newpath=base_dir
      )
      nx.drawing.nx_pydot.write_dot(pklgraph, simple_dot)
  
      # Convert .dot if format != 'dot'
      simplefname, res = _run_dot(simple_dot, format_ext=format)
      if res is not None and res.runtime.returncode:
          logger.warning("dot2png: %s", res.runtime.stderr)
  
      if show:
          pos = nx.graphviz_layout(pklgraph, prog="dot")
          nx.draw(pklgraph, pos)
          if show_connectinfo:
              nx.draw_networkx_edge_labels(pklgraph, pos)
  
      return simplefname if simple_form else outfname
  
imports: import os
  import sys
  import pickle
  from collections import defaultdict
  import re
  from copy import deepcopy
  from glob import glob
  from pathlib import Path
  from traceback import format_exception
  from hashlib import sha1
  from functools import reduce
  import numpy
  from ...None import logging, config
  from ...utils.filemanip import indirectory, relpath, fname_presuffix, ensure_list, get_related_files, save_json, savepkl, loadpkl, write_rst_header, write_rst_dict, write_rst_list
  from ...utils.misc import str2bool
  from ...utils.functions import create_function_from_source
  from ...interfaces.base.traits_extension import rebase_path_traits, resolve_path_traits, OutputMultiPath, isdefined, Undefined
  from ...interfaces.base.support import Bunch, InterfaceResult
  from ...interfaces.base import CommandLine
  from ...interfaces.utility import IdentityInterface
  from ...utils.provenance import ProvStore, pm, nipype_ns, get_id
  from inspect import signature
label_desc: Use image node_id 36 for calling a global function with example usage: export_graph(graph_in, base_dir, show, use_execgraph, show_connectinfo, dotfilename, format, simple_form) and returns: unknown