class_docstr: FileArchive that can automatically capture notebook data via the
  display hooks and automatically adds a notebook HTML snapshot to
  the archive upon export.
class_docstr_tok: ["FileArchive","that","can","automatically","capture","notebook","data","via","the","display","hooks","and","automatically","adds","a","notebook","HTML","snapshot","to","the","archive","upon","export","."]
docstr: Method to enable or disable automatic capture, allowing you to
  simultaneously set the instance parameters.
docstr_tok: ["Method","to","enable","or","disable","automatic","capture",",","allowing","you","to","simultaneously","set","the","instance","parameters","."]
code: def auto(self, enabled=True, clear=False, **kwargs):
      """
      Method to enable or disable automatic capture, allowing you to
      simultaneously set the instance parameters.
      """
      self.namespace = self.get_namespace()
      self.notebook_name = "{notebook}"
      self._timestamp = tuple(time.localtime())
      kernel = r"var kernel = IPython.notebook.kernel; "
      nbname = r"var nbname = IPython.notebook.get_notebook_name(); "
      nbcmd = (
          r"var name_cmd = '%s.notebook_name = \"' + nbname + '\"'; "
          % self.namespace
      )
      cmd = kernel + nbname + nbcmd + "kernel.execute(name_cmd); "
      display(Javascript(cmd))
      time.sleep(0.5)
      self._auto = enabled
      self.param.update(**kwargs)
      tstamp = time.strftime(" [%Y-%m-%d %H:%M:%S]", self._timestamp)
      # When clear == True, it clears the archive, in order to start a new auto capture in a clean archive
      if clear:
          FileArchive.clear(self)
      print(
          "Automatic capture is now {}.{}".format(
              "enabled" if enabled else "disabled",
              tstamp if enabled else "",
          )
      )
  
imports: import os
  import sys
  import time
  import traceback
  import param
  from IPython.display import Javascript, display
  from nbconvert import HTMLExporter, NotebookExporter
  from nbconvert.preprocessors.clearoutput import ClearOutputPreprocessor
  from nbformat import reader
  from ..core.io import FileArchive, Pickler
  from ..plotting.renderer import HTML_TAGS, MIME_TYPES
  from .preprocessors import Substitute
label_desc: Use image node_id 4 for calling the NotebookArchive obj's underlying member method code with example usage: obj.auto(enabled, clear) without return types