To be called by issueBatchJobs.

        Returns the jobID if the jobNode has been submitted to the local queue,
        otherwise returns None
970762
def handleLocalJob(self, jobNode):  # type: (JobNode) -> Optional[int]
        
        if (not self.config.runCwlInternalJobsOnWorkers
                and jobNode.jobName.startswith(CWL_INTERNAL_JOBS)):
            return self.localBatch.issueBatchJob(jobNode)
        else:
            return None
372497
def get_job_id(self, response):
        """"""
        lines = [line.strip() for line in response.split("\n")
                if line.strip() != '']
        last_line = lines[-1]
        match = re.match('(\d+)\.[\w.-]+$', last_line)
        if match:
            return match.group(1)
        else:
            return None
1237960
public Job getJobFromId(String jobName) {
    // [START ]
    JobId jobIdObject = JobId.of(jobName);
    Job job = bigquery.getJob(jobIdObject);
    if (job == null) {
      // job was not found
    }
    // [END ]
    return job;
  }
522288
def job_skipped_message(self, job, queue):
        
        return '[%s|%s|%s] job skipped (current status: %s)' % (
                queue._cached_name,
                job.pk.get(),
                job._cached_identifier,
                STATUSES.by_value(job._cached_status, 'UNKNOWN'))
139116
def submit(self, *items):
		""""""
		with self.lock:
			if self.closed:
				raise BrokenPipe('Job submission has been closed.')
			id = self.jobcount
			self._status += ['SUBMITTED'] * len(items)
			self.jobcount += len(items)
			for item in items:
				self.waitqueue.put((id, item))
				id += 1
		if len(items) == 1:
			return id - 1
		else:
			return range(id - len(items), id)
619841
private <Q, R> void recordFinalStatus(JobIdentifier<Q, R> jobId, JobStatus<Q, R> jobStatus) {
        try {
            _jobStatusDAO.updateJobStatus(jobId, jobStatus);
        } catch (Exception e) {
            _log.error("Failed to record final status for job: [id={}, status={}]", jobId, jobStatus.getStatus(), e);
        }
    }
1092719
def wait(self, poll_interval=1, timeout=None, full_data=False):
        

        end_time = None
        if timeout:
            end_time = time.time() + timeout

        while end_time is None or time.time() < end_time:

            job_data = self.collection.find_one({
                "_id": ObjectId(self.id),
                "status": {"$nin": ["started", "queued"]}
            }, projection=({
                "_id": 0,
                "result": 1,
                "status": 1
            } if not full_data else None))

            if job_data:
                return job_data

            time.sleep(poll_interval)
        raise Exception("Waited for job result for %s seconds, timeout." % timeout)
830848
def job(self):
        
        if self._submitter and hasattr(self._submitter, '_job_access'):
            return self._submitter._job_access()
        return None
105940
def get_job_id(short=True):
    

    jobid = os.environ.get('PBS_JOBID', '')

    if short:
        # Strip off '.rman2'
        jobid = jobid.split('.')[0]

    return(jobid)
42506
def get_job_ids(self):
        """"""
        if not self.parsed_response:
            return None
        try:
            job_ids = self.parsed_response["files"]["results.xml"]["job-ids"]
        except KeyError:
            return None
        if not job_ids or job_ids == [0]:
            return None
        return job_ids
624964
def getUpdatedBatchJob(self, maxWait):
        """"""
        try:
            item = self.outputQueue.get(timeout=maxWait)
        except Empty:
            return None
        jobID, exitValue, wallTime = item
        jobCommand = self.jobs.pop(jobID)
        log.debug("Ran jobID: %s with exit value: %i", jobID, exitValue)
        return jobID, exitValue, wallTime
635963
private synchronized JobMonitor getJobMonitor(JobStatus status) {
    UUID jobId = status.getJobId();
    JobMonitor monitor = monitors.get(jobId);
    if (monitor == null) {
      monitor = new JobMonitor(factory.createProgressMonitor(status.getDescription()));
      monitors.put(jobId, monitor);
    }
    return monitor;
  }
98109
def get_job_by_id(job_id, conn=None):
    
    job = RBJ.get(job_id).run(conn)
    return job
134084
static String getJobIdFromPath(Path aPath) {
    String fileName = aPath.getName();
    JobFile jf = new JobFile(fileName);
    String jobId = jf.getJobid();
    if(jobId == null) {
      throw new ProcessingException("job id is null for " + aPath.toUri());
    }
    return jobId;
  }
862282
def check_job(self, job_id):
        
        resp = self._call(endpoint='status', data={'job_id': job_id})
        map = {'id': 'job_id', 'status': 'status_code', 'type': 'type_code'}
        job_status_args = {map.get(k, k): v for k, v in resp.items()}
        return JobStatus(**job_status_args)
544376
async def _handle_job_queue_update(self, message: BackendGetQueue):
        
        self._logger.debug("Received job queue update")
        self._queue_update_last_attempt = 0
        self._queue_cache = message

        # Do some precomputation
        new_job_queue_cache = {}
        # format is job_id: (nb_jobs_before, max_remaining_time)
        for (job_id, is_local, _, _2, _3, _4, max_end) in message.jobs_running:
            if is_local:
                new_job_queue_cache[job_id] = (-1, max_end - time.time())
        wait_time = 0
        nb_tasks = 0
        for (job_id, is_local, _, _2, timeout) in message.jobs_waiting:
            if timeout > 0:
                wait_time += timeout
            if is_local:
                new_job_queue_cache[job_id] = (nb_tasks, wait_time)
            nb_tasks += 1

        self._queue_job_cache = new_job_queue_cache
1147585
def submit_job(self, job_definition, parameters, job_name=None, queue=None):
        """"""
        if job_name is None:
            job_name = _random_id()
        response = self._client.submit_job(
            jobName=job_name,
            jobQueue=queue or self.get_active_queue(),
            jobDefinition=job_definition,
            parameters=parameters
        )
        return response['jobId']