code: def cleanup(self):
          
          task = self.task
  
          # get job ids from submission data
          job_ids = [
              d["job_id"] for d in self.submission_data.jobs.values()
              if d["job_id"] not in (self.submission_data.dummy_job_id, None)
          ]
          if not job_ids:
              return
  
          # cleanup jobs
          task.publish_message("going to cleanup {} jobs".format(len(job_ids)))
          errors = self.job_manager.cleanup_batch(job_ids)
  
          # print errors
          if errors:
              print("{} error(s) occured while cleaning up {} job(s) of task {}:".format(
                  len(errors), len(job_ids), task.task_id))
              tmpl = "    {}"
              for i, err in enumerate(errors):
                  print(tmpl.format(err))
                  if i + 1 >= self.show_errors:
                      remaining = len(errors) - self.show_errors
                      if remaining > 0:
                          print("    ... and {} more".format(remaining))
                      break
docs: Cleans up jobs on the remote run location. The job ids are read from the submission file
          which has to exist for obvious reasons.