'Removes all jobs that would execute the given function.'

def unschedule_func(self, func):

    found = False
    self._jobstores_lock.acquire()
    try:
        for (alias, jobstore) in iteritems(self._jobstores):
            for job in list(jobstore.jobs):
                if (job.func == func):
                    self._remove_job(job, alias, jobstore)
                    found = True
    finally:
        self._jobstores_lock.release()
    if (not found):
        raise KeyError('The    given    function    is    not    scheduled    in    this    scheduler')
