'Removes a job, preventing it from being run any more.
:param str|unicode job_id: the identifier of the job
:param str|unicode jobstore: alias of the job store that contains the job
:raises JobLookupError: if the job was not found'

def remove_job(self, job_id, jobstore=None):

    with self._jobstores_lock:
        for (i, (job, jobstore_alias, replace_existing)) in enumerate(self._pending_jobs):
            if (job.id == job_id):
                del self._pending_jobs[i]
                jobstore = jobstore_alias
                break
        else:
            for (alias, store) in six.iteritems(self._jobstores):
                if (jobstore in (None, alias)):
                    try:
                        store.remove_job(job_id)
                    except JobLookupError:
                        continue
                    jobstore = alias
                    break
    if (jobstore is None):
        raise JobLookupError(job_id)
    event = JobEvent(EVENT_JOB_REMOVED, job_id, jobstore)
    self._dispatch_event(event)
    self._logger.info('Removed    job    %s', job_id)
