'Finds a job by its ID.
:type job_id: str
:param str jobstore_alias: alias of a job store to look in
:return tuple[Job, str]: a tuple of job, jobstore alias (jobstore alias is None in case of a pending job)
:raises JobLookupError: if no job by the given ID is found.'

def _lookup_job(self, job_id, jobstore_alias):

    for (job, alias, replace_existing) in self._pending_jobs:
        if (job.id == job_id):
            return (job, None)
    for (alias, store) in six.iteritems(self._jobstores):
        if (jobstore_alias in (None, alias)):
            job = store.lookup_job(job_id)
            if (job is not None):
                return (job, alias)
    raise JobLookupError(job_id)
