docstr: Save the source to file and render with the Graphviz engine.
  
  Args:
      filename: Filename for saving the source (defaults to ``name`` + ``'.gv'``)
      directory: (Sub)directory for source saving and rendering.
      view (bool): Open the rendered result with the default application.
      cleanup (bool): Delete the source file after successful rendering.
      format: The output format used for rendering (``'pdf'``, ``'png'``, etc.).
      renderer: The output renderer used for rendering (``'cairo'``, ``'gd'``, ...).
      formatter: The output formatter used for rendering (``'cairo'``, ``'gd'``, ...).
      quiet (bool): Suppress ``stderr`` output from the layout subprocess.
      quiet_view (bool): Suppress ``stderr`` output from the viewer process
                         (implies ``view=True``, ineffective on Windows).
  
  Returns:
      The (possibly relative) path of the rendered file.
  
  Raises:
      ValueError: If ``format``, ``renderer``, or ``formatter`` are not known.
      graphviz.RequiredArgumentError: If ``formatter`` is given but ``renderer`` is None.
      graphviz.ExecutableNotFound: If the Graphviz executable is not found.
      subprocess.CalledProcessError: If the exit status is non-zero.
      RuntimeError: If viewer opening is requested but not supported.
  
  The layout command is started from the directory of ``filepath``, so that
  references to external files (e.g. ``[image=...]``) can be given as paths
  relative to the DOT source file.
docstr_tok: ["Save","the","source","to","file","and","render","with","the","Graphviz","engine",".","Args",":","filename",":","Filename","for","saving","the","source","(","defaults","to","``","name","``","+","``","'.gv","'","``",")","directory",":","(","Sub",")","directory","for","source","saving","and","rendering",".","view","(","bool",")",":","Open","the","rendered","result","with","the","default","application",".","cleanup","(","bool",")",":","Delete","the","source","file","after","successful","rendering",".","format",":","The","output","format","used","for","rendering","(","``","'pdf","'","``",",","``","'png","'","``",",","etc.",")",".","renderer",":","The","output","renderer","used","for","rendering","(","``","'cairo","'","``",",","``","'gd","'","``",",","...",")",".","formatter",":","The","output","formatter","used","for","rendering","(","``","'cairo","'","``",",","``","'gd","'","``",",","...",")",".","quiet","(","bool",")",":","Suppress","``","stderr","``","output","from","the","layout","subprocess",".","quiet_view","(","bool",")",":","Suppress","``","stderr","``","output","from","the","viewer","process","(","implies","``","view=True","``",",","ineffective","on","Windows",")",".","Returns",":","The","(","possibly","relative",")","path","of","the","rendered","file",".","Raises",":","ValueError",":","If","``","format","``",",","``","renderer","``",",","or","``","formatter","``","are","not","known",".","graphviz.RequiredArgumentError",":","If","``","formatter","``","is","given","but","``","renderer","``","is","None",".","graphviz.ExecutableNotFound",":","If","the","Graphviz","executable","is","not","found",".","subprocess.CalledProcessError",":","If","the","exit","status","is","non-zero",".","RuntimeError",":","If","viewer","opening","is","requested","but","not","supported",".","The","layout","command","is","started","from","the","directory","of","``","filepath","``",",","so","that","references","to","external","files","(","e.g",".","``","[","image=","...","]","``",")","can","be","given","as","paths","relative","to","the","DOT","source","file","."]
code: def render(
      self,
      filename=None,
      directory=None,
      view=False,
      cleanup=False,
      format=None,
      renderer=None,
      formatter=None,
      quiet=False,
      quiet_view=False,
  ):
      """Save the source to file and render with the Graphviz engine.
  
      Args:
          filename: Filename for saving the source (defaults to ``name`` + ``'.gv'``)
          directory: (Sub)directory for source saving and rendering.
          view (bool): Open the rendered result with the default application.
          cleanup (bool): Delete the source file after successful rendering.
          format: The output format used for rendering (``'pdf'``, ``'png'``, etc.).
          renderer: The output renderer used for rendering (``'cairo'``, ``'gd'``, ...).
          formatter: The output formatter used for rendering (``'cairo'``, ``'gd'``, ...).
          quiet (bool): Suppress ``stderr`` output from the layout subprocess.
          quiet_view (bool): Suppress ``stderr`` output from the viewer process
                             (implies ``view=True``, ineffective on Windows).
  
      Returns:
          The (possibly relative) path of the rendered file.
  
      Raises:
          ValueError: If ``format``, ``renderer``, or ``formatter`` are not known.
          graphviz.RequiredArgumentError: If ``formatter`` is given but ``renderer`` is None.
          graphviz.ExecutableNotFound: If the Graphviz executable is not found.
          subprocess.CalledProcessError: If the exit status is non-zero.
          RuntimeError: If viewer opening is requested but not supported.
  
      The layout command is started from the directory of ``filepath``, so that
      references to external files (e.g. ``[image=...]``) can be given as paths
      relative to the DOT source file.
      """
      filepath = self.save(filename, directory)
  
      if format is None:
          format = self._format
  
      rendered = backend.render(
          self._engine,
          format,
          filepath,
          renderer=renderer,
          formatter=formatter,
          quiet=quiet,
      )
  
      if cleanup:
          log.debug("delete %r", filepath)
          os.remove(filepath)
  
      if quiet_view or view:
          self._view(rendered, self._format, quiet_view)
  
      return rendered
  
imports: import codecs
  import locale
  import logging
  import os
  from .None import backend
  from .None import tools
label_desc: Use image node_id 9 for calling the File obj's underlying member method code with example usage: obj.render(filename, directory, view, cleanup, format, renderer, formatter, quiet, quiet_view) and returns: rendered