code: def save(
      obj,
      filename,
      fmt="auto",
      backend=None,
      resources="cdn",
      toolbar=None,
      title=None,
      **kwargs,
  ):
      """
      Saves the supplied object to file.
  
      The available output formats depend on the backend being used. By
      default and if the filename is a string the output format will be
      inferred from the file extension. Otherwise an explicit format
      will need to be specified. For ambiguous file extensions such as
      html it may be necessary to specify an explicit fmt to override
      the default, e.g. in the case of 'html' output the widgets will
      default to fmt='widgets', which may be changed to scrubber widgets
      using fmt='scrubber'.
  
      Arguments
      ---------
      obj: HoloViews object
          The HoloViews object to save to file
      filename: string or IO object
          The filename or BytesIO/StringIO object to save to
      fmt: string
          The format to save the object as, e.g. png, svg, html, or gif
          and if widgets are desired either 'widgets' or 'scrubber'
      backend: string
          A valid HoloViews rendering backend, e.g. bokeh or matplotlib
      resources: string or bokeh.resource.Resources
          Bokeh resources used to load bokehJS components. Defaults to
          CDN, to embed resources inline for offline usage use 'inline'
          or bokeh.resources.INLINE.
      toolbar: bool or None
          Whether to include toolbars in the exported plot. If None,
          display the toolbar unless fmt is `png` and backend is `bokeh`.
          If `True`, always include the toolbar.  If `False`, do not include the
          toolbar.
      title: string
          Custom title for exported HTML file
      **kwargs: dict
          Additional keyword arguments passed to the renderer,
          e.g. fps for animations
      """
      backend = backend or Store.current_backend
      renderer_obj = renderer(backend)
      if (
          not toolbar
          and backend == "bokeh"
          and (
              fmt == "png"
              or (
                  isinstance(filename, str) and filename.endswith("png")
              )
          )
      ):
          obj = obj.opts(toolbar=None, backend="bokeh", clone=True)
      elif toolbar is not None and not toolbar:
          obj = obj.opts(toolbar=None)
      if kwargs:
          renderer_obj = renderer_obj.instance(**kwargs)
      if isinstance(filename, Path):
          filename = str(filename.absolute())
      if isinstance(filename, str):
          supported = [
              mfmt
              for tformats in renderer_obj.mode_formats.values()
              for mfmt in tformats
          ]
          formats = filename.split(".")
          if fmt == "auto" and formats and formats[-1] != "html":
              fmt = formats[-1]
          if formats[-1] in supported:
              filename = ".".join(formats[:-1])
      return renderer_obj.save(
          obj, filename, fmt=fmt, resources=resources, title=title
      )
  
imports: import inspect
  import os
  import shutil
  import sys
  from collections import defaultdict
  from inspect import Parameter, Signature
  from pathlib import Path
  from types import FunctionType
  import param
  from pyviz_comms import extension
  from ..core import Dataset, Dimensioned, DynamicMap, HoloMap, Store, StoreOptions, ViewableElement, util
  from ..core.operation import Operation, OperationCallable
  from ..core.options import Keywords, Options, options_policy
  from ..core.overlay import Overlay
  from ..core.util import merge_options_to_dict
  from ..operation.element import function
  from ..streams import Params, Stream, streams_list_from_dict
  from .settings import OutputSettings, list_backends, list_formats
label_desc: Use image node_id 3 for calling a global function with example usage: save(obj, filename, fmt, backend, resources, toolbar, title) and returns: renderer_obj