@app.route('/', methods=['POST'])
def hook_listen():
    if request.method == 'POST':
        token = request.args.get('token')
        if token == config['token']:
            hook = request.args.get('hook')

            if hook:
                hook_value = config['hooks'].get(hook)

                if hook_value:
                    try:
                        subprocess.call(hook_value)
                        return jsonify(success=True), 200
                    except __HOLE__ as e:
                        return jsonify(success=False, error=str(e)), 400
                else:
                    return jsonify(success=False, error="Hook not found"), 404
            else:
                return jsonify(success=False, error="Invalid request: missing hook"), 400
        else:
            return jsonify(success=False, error="Invalid token"), 400
dataset/ETHPy150Open glowdigitalmedia/docker-puller/dockerpuller/app.py/hook_listen