code: def delete_running(self, timeout_last_refresh=0, dry_run=False):
          
          running_all = self.handle.jobs_running()
          running_timeout = [job for job in running_all
                             if coarse_utcnow() > job["refresh_time"] +
                             timedelta(seconds=timeout_last_refresh)]
          if len(running_timeout) == 0:
              # Nothing to stop
              self.refresh_tids(None)
              return None
  
          if dry_run:
              logger.warning("Dry run. Not removing anything.")
  
          logger.info("Removing {0}/{1} running jobs. # all jobs: {2} ".
                      format(len(running_timeout), len(running_all), len(self)))
  
          now = coarse_utcnow()
          logger.info("Current utc time: {0}".format(now))
          logger.info("Time horizont: {0}".format(now - timedelta(seconds=timeout_last_refresh)))
          for job in running_timeout:
              logger.info("Removing job: ")
              pjob = job.to_dict()
              del pjob["misc"]  # ignore misc when printing
              logger.info(pprint.pformat(pjob))
              if not dry_run:
                  self.handle.delete(job)
                  logger.info("Job deleted")
          self.refresh_tids(None)
docs: Delete jobs stalled in the running state for too long
  
          timeout_last_refresh, int: number of seconds