(ns)
return lock
This process was given a specific --job_id arg.
    Decide whether it's okay to execute this job_id,
    and if its okay to go forward, set job_id state appropriately
This process was given a specific --job_id arg.
    Decide whether it's okay to execute this job_id,
    and if its okay to go forward, set job_id state appropriately
This process was given a specific -- job_id arg . Decide whether it s okay to execute this job_id and if its okay to go forward set job_id state appropriately
def _handle_manually_given_job_id(ns):
    """This process was given a specific --job_id arg.
    Decide whether it's okay to execute this job_id,
    and if its okay to go forward, set job_id state appropriately
    """
    log.warn(
        ('using specific job_id and'
         ' blindly assuming this job is not already queued.'),
        extra=dict(app_name=ns.app_name, job_id=ns.job_id))
    if qb.get_qbclient().exists(qb.get_job_path(ns.app_name, ns.job_id)):
        msg = ('Will not execute this task because it might be already'
               ' queued or completed!')
        log.critical(
            msg, extra=dict(app_name=ns.app_name, job_id=ns.job_id))
        raise UserWarning(msg)
    lock = qb.obtain_execute_lock(
        ns.app_name, ns.job_id, safe=False, raise_on_error=True,
        blocking=False)
    qb.set_state(ns.app_name, ns.job_id, pending=True)
    return lock
def _handle_manually_given_job_id ( ns ) : log . warn ( ( 'using specific job_id and' ' blindly assuming this job is not already queued.' ) , extra = dict ( app_name = ns . app_name , job_id = ns . job_id ) ) if qb . get_qbclient ( ) . exists ( qb . get_job_path ( ns . app_name , ns . job_id ) ) : msg = ( 'Will not execute this task because it might be already' ' queued or completed!' ) log . critical ( msg , extra = dict ( app_name = ns . app_name , job_id = ns . job_id ) ) raise UserWarning ( msg ) lock = qb . obtain_execute_lock ( ns . app_name , ns . job_id , safe = False , raise_on_error = True , blocking = False ) qb . set_state ( ns . app_name , ns . job_id , pending = True ) return lock