code: def report(
      text,
      path,
      stylesheet=None,
      defaultenc="utf8",
      template=None,
      metadata=None,
      **files,
  ):
      """Create an HTML report using python docutils.
  
      This is deprecated in favor of the --report flag.
  
      Attention: This function needs Python docutils to be installed for the
      python installation you use with Snakemake.
  
      All keywords not listed below are interpreted as paths to files that shall
      be embedded into the document. The keywords will be available as link
      targets in the text. E.g. append a file as keyword arg via F1=input[0]
      and put a download link in the text like this:
  
      .. code:: python
  
          report('''
          ==============
          Report for ...
          ==============
  
          Some text. A link to an embedded file: F1_.
  
          Further text.
          ''', outputpath, F1=input[0])
  
          Instead of specifying each file as a keyword arg, you can also expand
          the input of your rule if it is completely named, e.g.:
  
          report('''
          Some text...
          ''', outputpath, **input)
  
      Args:
          text (str):         The "restructured text" as it is expected by python docutils.
          path (str):         The path to the desired output file
          stylesheet (str):   An optional path to a CSS file that defines the style of the document. This defaults to <your snakemake install>/report.css. Use the default to get a hint on how to create your own.
          defaultenc (str):   The encoding that is reported to the browser for embedded text files, defaults to utf8.
          template (str):     An optional path to a docutils HTML template.
          metadata (str):     E.g. an optional author name or email address.
  
      """
      if stylesheet is None:
          os.path.join(os.path.dirname(__file__), "report.css")
      try:
          import snakemake.report
      except ImportError:
          raise WorkflowError(
              "Python 3 package docutils needs to be installed to use the report function."
          )
      snakemake.report.report(
          text,
          path,
          stylesheet=stylesheet,
          defaultenc=defaultenc,
          template=template,
          metadata=metadata,
          **files,
      )
  
imports: import os
  import json
  import re
  import inspect
  import textwrap
  from itertools import chain
  import collections
  import multiprocessing
  import string
  import shlex
  import sys
  from urllib.parse import urljoin
  from snakemake.io import Namedlist, Wildcards
  from snakemake.common.configfile import _load_configfile
  from snakemake.logging import logger
  from snakemake.common import ON_WINDOWS
  from snakemake.exceptions import WorkflowError
  from snakemake.io import regex_from_filepattern
label_desc: Use image node_id 6 for calling a global function with example usage: report(text, path, stylesheet, defaultenc, template, metadata) without return types