code: def write_html(clf, html, text, postfix="", caller_depth=1):
      """Write to html file in .html directory. Filename is generated from calling
      function name and module, and clf class name.
      This is useful to check and debug format_as_html function.
      """
      caller = inspect.stack()[caller_depth]
      try:
          test_name, test_file = caller.function, caller.filename
      except AttributeError:
          test_name, test_file = caller[3], caller[1]
      test_file = os.path.basename(test_file).rsplit(".", 1)[0]
      filename = "{}_{}_{}{}.html".format(
          test_file, test_name, clf.__class__.__name__, postfix
      )
      dirname = ".html"
      if not os.path.isdir(dirname):
          os.mkdir(dirname)
      path = os.path.join(dirname, filename)
      with open(path, "wb") as f:
          f.write(
              "Text:<pre>{text}</pre>End of text<hr/>\n{html}".format(
                  text=html_escape(text), html=html
              ).encode("utf8")
          )
      print("html written to {}".format(path))
  
file_path: eli5/tests/utils.py
imports: from __future__ import print_function
  import os
  import inspect
  import json
  from pprint import pprint
  from hypothesis.strategies import integers
  from hypothesis.extra.numpy import arrays
  import numpy
  from eli5.base import Explanation
  from eli5.formatters import format_as_text, format_as_html, format_as_dict
  from eli5.formatters.html import html_escape
  from eli5.formatters.text import format_signed
  from eli5.sklearn.utils import sklearn_version
label_desc: Use image node_id 4 for calling a global function with example usage: write_html(clf, html, text, postfix, caller_depth) without return types