def getJob(conn):
    """
    Get the next available sandbox request and set its status to pending.
    """
    cur = conn.execute("SELECT cocreate_sandboxrequest.id, cocreate_sandboxrequest.sandbox_id, cocreate_sandboxrequest.requested_by_id, cocreate_sandboxrequest.sandbox_name, cocreate_sandboxtemplate.recipe FROM cocreate_sandboxrequest, cocreate_sandboxtemplate WHERE cocreate_sandboxrequest.request_status = 'app' AND cocreate_sandboxrequest.template_id = cocreate_sandboxtemplate.id LIMIT 1")
    try:
        request_id, sandbox_id, requested_by_id, sandbox_name, sandbox_recipe = cur.fetchone()
        conn.execute("UPDATE cocreate_sandboxrequest SET request_status = 'pen' WHERE id = ?", (request_id,))
        conn.commit()
    except __HOLE__:
        return None
            
    return {"request_id": request_id, "sandbox_id": sandbox_id, "requested_by_id": requested_by_id, "sandbox_name": sandbox_name, "sandbox_recipe": sandbox_recipe}
dataset/ETHPy150Open ngageoint/cocreate/ccl-cookbook/files/default/cocreatelite/cocreate/worker.py/getJob