@app.route('/status/<id>', methods=['DELETE'])
def delete_task_status(id):
    # obtain the task and validate it
    global background_tasks
    rv = background_tasks.get(id)
    if rv is None:
        return not_found(None)

    # if the task is still running it cannot be deleted
    if isinstance(rv, Thread):
        return bad_request()

    del background_tasks[id]
    return jsonify({}), 200
Delete an asynchronous task resource.
dataset/ETHPy150Open miguelgrinberg/oreilly-flask-apis-video/camera/camera.py/delete_task_status