'Stop the given job. The input variable job may be either a Job or a Task.'

def stop(self, job):

    if isinstance(job, model.Job):
        log.debug('Stopping    job    %d:', job.get_id())
    elif isinstance(job, model.Task):
        log.debug(('Stopping    job    %d,    task    %d' % (job.get_job().get_id(), job.get_id())))
    else:
        log.debug('Unknown    job    to    stop')
    if (job.get_job_runner_name() is not None):
        runner_name = job.get_job_runner_name().split(':', 1)[0]
        if isinstance(job, model.Job):
            log.debug(('stopping    job    %d    in    %s    runner' % (job.get_id(), runner_name)))
        elif isinstance(job, model.Task):
            log.debug(('Stopping    job    %d,    task    %d    in    %s    runner' % (job.get_job().get_id(), job.get_id(), runner_name)))
        try:
            self.job_runners[runner_name].stop_job(job)
        except KeyError:
            log.error(('stop():    (%s)    Invalid    job    runner:    %s' % (job.get_id(), runner_name)))
