def METHOD_NAME(compiler, hpy_debug_capture):
    # Basic sanity check that valid code does not trigger any error reports
    mod = compiler.make_module("""
        HPyDef_METH(build, "build", HPyFunc_VARARGS)
        static HPy build_impl(HPyContext *ctx, HPy h_self, const HPy *args, size_t nargs)
        {
            HPyTupleBuilder tbuilder = HPyTupleBuilder_New(ctx, nargs);
            HPyListBuilder lbuilder = HPyListBuilder_New(ctx, nargs);
            for (size_t i=0; i < nargs; i++) {
                HPyTupleBuilder_Set(ctx, tbuilder, i, args[i]);
                HPyListBuilder_Set(ctx, lbuilder, i, args[i]);
            }
            HPy t = HPyTupleBuilder_Build(ctx, tbuilder);
            HPy l = HPyListBuilder_Build(ctx, lbuilder);
            HPy h_result = HPyTuple_Pack(ctx, 2, t, l);
            HPy_Close(ctx, t);
            HPy_Close(ctx, l);
            return h_result;
        }
        HPyDef_METH(cancel, "cancel", HPyFunc_VARARGS)
        static HPy cancel_impl(HPyContext *ctx, HPy h_self, const HPy *args, size_t nargs)
        {
            HPyTupleBuilder tbuilder = HPyTupleBuilder_New(ctx, nargs);
            HPyListBuilder lbuilder = HPyListBuilder_New(ctx, nargs);
            for (size_t i=0; i < nargs; i++) {
                HPyTupleBuilder_Set(ctx, tbuilder, i, args[i]);
                HPyListBuilder_Set(ctx, lbuilder, i, args[i]);
            }
            HPyTupleBuilder_Cancel(ctx, tbuilder);
            HPyListBuilder_Cancel(ctx, lbuilder);
            return HPy_Dup(ctx, ctx->h_None);
        }
        @EXPORT(build)
        @EXPORT(cancel)
        @INIT
        """)
    assert mod.build('hello', 42, None) == (('hello', 42, None), ['hello', 42, None])
    assert mod.cancel('hello', 42, None) is None
    assert hpy_debug_capture.invalid_builders_count == 0