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 engine 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: typing.Union[os.PathLike, str],
      directory: typing.Union[os.PathLike, str, None] = None,
      format: typing.Optional[str] = None,
      engine: typing.Optional[str] = None,
      encoding: typing.Optional[str] = DEFAULT_ENCODING,
      renderer: typing.Optional[str] = None,
      formatter: typing.Optional[str] = None,
  ) -> "Source":
      """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.
      """
      directory = _tools.promote_pathlike_directory(directory)
      filepath = (
          os.path.join(directory, filename)
          if directory.parts
          else os.fspath(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=filename,
          directory=directory,
          format=format,
          engine=engine,
          encoding=encoding,
          renderer=renderer,
          formatter=formatter,
          loaded_from_path=filepath,
      )
  
imports: import locale
  import logging
  import os
  import typing
  from .encoding import DEFAULT_ENCODING
  from .None import _tools
  from .None import saving
  from .None import jupyter_integration
  from .None import piping
  from .None import rendering
  from .None import unflattening
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, renderer, formatter) and returns: cls