code: def cache_by_status(func):
      
      @functools.wraps(func)
      def wrapper(self, job_data, event, job_num, *args, **kwargs):
          job_id = job_data["job_id"]
          dashboard_status = self.map_status(job_data.get("status"), event)
  
          # nothing to do when the status is invalid or did not change
          if not dashboard_status or self._last_states.get(job_id) == dashboard_status:
              return None
  
          # set the new status
          self._last_states[job_id] = dashboard_status
  
          return func(self, job_data, event, job_num, *args, **kwargs)
  
      return wrapper
docs: Decorator for :py:meth:`BaseJobDashboard.publish` (and inheriting classes) that caches the last
      published status to decide if the a new publication is necessary or not. When the status did not
      change since the last call, the actual publish method is not invoked and *None* is returned.