def METHOD_NAME():
    path = "./spec/" + request.args["f"]
    variables = request.args["vars"].splitlines(keepends=False)
    mode = request.args["mode"]
    data = request.json
    def filter_args(solution, mode, variables):
        if mode == "exclude":
            for x in variables:
                delattr(solution, x)
        else:
            all_vars = [x for x in solution.__dict__.keys()]
            for x in all_vars:
                if x not in variables:
                    delattr(solution, x)
        return solution
    test = load_spec(data)
    generated = []
    for solver in test.solvers:
        model, result, required, obtained = test.run(path, solver)
        if not test.passed(result):
            if isinstance(obtained, spec.Result):
                if isinstance(obtained.solution, list):
                    obtained.solution = [
                        filter_args(s, mode, variables) for s in obtained.solution
                    ]
                else:
                    filter_args(obtained.solution, mode, variables)
            test.expected.append(obtained)
            generated.append({"value": yaml.dump(obtained)})
    return jsonify({"obtained": generated})