code: def resubmit(self, stream=sys.stdout, fail_running=False, resubmit_failed=False):
          
          self._build_job_dict()
          status_vect = self.check_status(stream, check_once=True, fail_pending=True,
                                          fail_running=fail_running)
          status = status_vect.get_status()
          if status == JobStatus.done:
              return status
  
          failed_jobs = self._scatter_link.get_failed_jobs(True, True)
          if failed_jobs:
              scatter_status = self._interface.submit_jobs(self._scatter_link, failed_jobs,
                                                           job_archive=self._job_archive,
                                                           stream=stream)
              if scatter_status == JobStatus.failed:
                  return JobStatus.failed
  
          status_vect = self.check_status(stream, write_status=True)
          status = status_vect.get_status()
  
          if status == JobStatus.partial_failed:
              if resubmit_failed:
                  sys.stdout.write("Resubmitting partially failed link %s\n" %
                                   self.full_linkname)
                  status_vect = self.resubmit(stream=stream, fail_running=False, resubmit_failed=False)
              else:
                  sys.stdout.write("NOT resubmitting partially failed link %s\n" %
                                   self.full_linkname)
  
          if self.args['dry_run']:
              return JobStatus.unknown
          return status_vect
docs: Function to resubmit failed jobs and collect results
  
          Parameters
          -----------
          stream : `file`
              Stream that this function will print to,
              Must have 'write' function.
  
          fail_running : `bool`
              If True, consider running jobs as failed
  
          resubmit_failed : bool
              Resubmit failed jobs.
  
          Returns
          -------
          status_vect : `JobStatusVector`
              Vector that summarize the number of jobs in various states.