merge_machine/api.py
def count_jobs_in_queue_before(job_id):
    '''
    Returns the number of jobs preceding job_id or -1 if job is no longer in queue.
    
    GET:
        - job_id: as returned by schedule_job
    '''
    job_ids = q.job_ids
    if job_id in job_ids:
        return jsonify(num_jobs=job_ids.index(job_id))
    else:
        return jsonify(num_jobs=-1)
    # TODO: check if better to return error

    Returns the number of jobs preceding job_id or -1 if job is no longer in queue.
    
    GET:
        - job_id: as returned by schedule_job
    
Returns the number of jobs preceding job_id or -1 if job is no longer in queue.
Returns the number of jobs preceding job_id or - 1 if job is no longer in queue .
def count_jobs_in_queue_before(job_id):
    job_ids = q.job_ids
    if job_id in job_ids:
        return jsonify(num_jobs=job_ids.index(job_id))
    else:
        return jsonify(num_jobs=-1)
def count_jobs_in_queue_before ( job_id ) : job_ids = q . job_ids if job_id in job_ids : return jsonify ( num_jobs = job_ids . index ( job_id ) ) else : return jsonify ( num_jobs = - 1 )
Returns the number of jobs preceding job_id or -1 if job is no longer in queue.
Returns the number of jobs preceding job_id or - 1 if job is no longer in queue .
'''
    Returns the number of jobs preceding job_id or -1 if job is no longer in queue.
    
    GET:
        - job_id: as returned by schedule_job
    ''' # TODO: check if better to return error
job_id