code: def save_html(out_file, plot, full_html=True):
      """Save html plots to an output file.
  
      Parameters
      ----------
      out_file : str or file
          Location or file to be written to.
  
      plot : BaseVisualizer
          Visualizer returned by :func:`shap.plots.force()`.
  
      full_html : boolean (default: True)
          If ``True``, writes a complete HTML document starting
          with an ``<html>`` tag. If ``False``, only script and div
          tags are included.
      """
  
      if not isinstance(plot, BaseVisualizer):
          raise TypeError(
              "`save_html` requires a Visualizer returned by `shap.plots.force()`."
          )
  
      internal_open = False
      if isinstance(out_file, str):
          out_file = open(out_file, "w", encoding="utf-8")
          internal_open = True
  
      if full_html:
          out_file.write(
              "<html><head><meta http-equiv='content-type' content='text/html'; charset='utf-8'>"
          )
  
      # dump the js code
      out_file.write(getjs())
  
      if full_html:
          out_file.write("</head><body>\n")
  
      out_file.write(plot.html())
  
      if full_html:
          out_file.write("</body></html>\n")
  
      if internal_open:
          out_file.close()
  
imports: import base64
  import json
  import os
  import random
  import re
  import string
  import warnings
  from collections.abc import Sequence
  import numpy
  import pandas
  import scipy.sparse
  from ..plots._force_matplotlib import draw_additive_plot
  from ..utils import hclust_ordering
  from ..utils._exceptions import DimensionError
  from ..utils._legacy import Data, DenseData, Instance, Link, Model, convert_to_link
  from ._labels import labels
label_desc: Use image node_id 4 for calling a global function with example usage: save_html(out_file, plot, full_html) without return types