class_docstr: Verbatim DOT source code string to be rendered by Graphviz.
  
  Args:
      source: The verbatim DOT source code string.
      filename: Filename for saving the source (defaults to ``'Source.gv'``).
      directory: (Sub)directory for source saving and rendering.
      format: Rendering output format (``'pdf'``, ``'png'``, ...).
      engine: Layout command used (``'dot'``, ``'neato'``, ...).
      encoding: Encoding for saving the source.
  
  Note:
      All parameters except ``source`` are optional. All of them can be changed
      under their corresponding attribute name after instance creation.
class_docstr_tok: ["Verbatim","DOT","source","code","string","to","be","rendered","by","Graphviz",".","Args",":","source",":","The","verbatim","DOT","source","code","string",".","filename",":","Filename","for","saving","the","source","(","defaults","to","``","'Source.gv","'","``",")",".","directory",":","(","Sub",")","directory","for","source","saving","and","rendering",".","format",":","Rendering","output","format","(","``","'pdf","'","``",",","``","'png","'","``",",","...",")",".","engine",":","Layout","command","used","(","``","'dot","'","``",",","``","'neato","'","``",",","...",")",".","encoding",":","Encoding","for","saving","the","source",".","Note",":","All","parameters","except","``","source","``","are","optional",".","All","of","them","can","be","changed","under","their","corresponding","attribute","name","after","instance","creation","."]
docstr: Return an instance with the source string read from the given file.
  
  Args:
      filename: Filename for loading/saving the source.
      directory: (Sub)directory for source loading/saving and rendering.
      format: Rendering output format (``'pdf'``, ``'png'``, ...).
      engine: Layout command used (``'dot'``, ``'neato'``, ...).
      encoding: Encoding for loading/saving the source.
docstr_tok: ["Return","an","instance","with","the","source","string","read","from","the","given","file",".","Args",":","filename",":","Filename","for","loading\/saving","the","source",".","directory",":","(","Sub",")","directory","for","source","loading\/saving","and","rendering",".","format",":","Rendering","output","format","(","``","'pdf","'","``",",","``","'png","'","``",",","...",")",".","engine",":","Layout","command","used","(","``","'dot","'","``",",","``","'neato","'","``",",","...",")",".","encoding",":","Encoding","for","loading\/saving","the","source","."]
code: def from_file(
      cls,
      filename,
      directory=None,
      format=None,
      engine=None,
      encoding=backend.ENCODING,
  ):
      """Return an instance with the source string read from the given file.
  
      Args:
          filename: Filename for loading/saving the source.
          directory: (Sub)directory for source loading/saving and rendering.
          format: Rendering output format (``'pdf'``, ``'png'``, ...).
          engine: Layout command used (``'dot'``, ``'neato'``, ...).
          encoding: Encoding for loading/saving the source.
      """
      filepath = os.path.join(directory or "", filename)
      if encoding is None:
          encoding = locale.getpreferredencoding()
      log.debug("read %r with encoding %r", filepath, encoding)
      with open(filepath, encoding=encoding) as fd:
          source = fd.read()
      return cls(source, filename, directory, format, engine, encoding)
  
imports: import codecs
  import locale
  import logging
  import os
  from .None import backend
  from .None import tools
label_desc: Use image node_id 1 for calling the Source obj's underlying member method code with example usage: obj.from_file(cls, filename, directory, format, engine, encoding) and returns: cls