class_docstr: A progress publisher that publishes to an IPython/Jupyter widget.
      
class_docstr_tok: ["A","progress","publisher","that","publishes","to","an","IPython\/Jupyter","widget","."]
code: def publish(self, model):
      if model.state == "init":
          self._heading.value = "<b>Analyzing Pipeline...</b>"
          self._set_progress(0.0)
          self._ensure_displayed()
  
      elif model.state in ("loading", "computing"):
          term_list = self._render_term_list(model.current_work)
          if model.state == "loading":
              details_heading = "<b>Loading Inputs:</b>"
          else:
              details_heading = "<b>Computing Expression:</b>"
          self._details_body.value = details_heading + term_list
  
          chunk_start, chunk_end = model.current_chunk_bounds
          self._heading.value = "<b>Running Pipeline</b>: Chunk Start={}, Chunk End={}".format(
              chunk_start.date(), chunk_end.date()
          )
  
          self._set_progress(model.percent_complete)
  
          self._ensure_displayed()
  
      elif model.state == "success":
          # Replace widget layout with html that can be persisted.
          self._stop_displaying()
          display(
              IPython_HTML(
                  "<b>Pipeline Execution Time:</b> {}".format(
                      self._format_execution_time(model.execution_time)
                  )
              ),
          )
  
      elif model.state == "error":
          self._bar.bar_style = "danger"
          self._stop_displaying()
      else:
          self._layout.close()
          raise ValueError(
              "Unknown display state: {!r}".format(model.state)
          )
  
imports: from collections import namedtuple
  import time
  from interface import implements
  from zipline.utils.compat import contextmanager, escape_html
  from zipline.utils.string_formatting import bulleted_list
  from .iface import PipelineHooks
label_desc: Use image node_id 2 for calling the IPythonWidgetProgressPublisher obj's underlying member method code with example usage: obj.publish(model) without return types