<commit_before>#include "Param.h"


namespace Halide {

void OutputImageParam::add_implicit_args_if_placeholder(std::vector<Expr> &args,
                                                        Expr last_arg,
                                                        int total_args,
                                                        bool *placeholder_seen) const {
    const Internal::Variable *var = last_arg.as<Internal::Variable>();
    bool is_placeholder = var && Var::is_placeholder(var->name);
    if (is_placeholder) {
        user_assert(!(*placeholder_seen))
            << "Only one implicit placeholder ('_') allowed in argument list for ImageParam " << name() << "\n";
        *placeholder_seen = true;

        // The + 1 in the conditional is because one provided argument is an placeholder
        for (int i = 0; i < (dimensions() - total_args + 1); i++) {
            args.push_back(Var::implicit(i));
        }
    } else {
        args.push_back(last_arg);
    }
}

OutputImageParam::OutputImageParam(const Internal::Parameter &p) :
    param(p) {
}

OutputImageParam::~OutputImageParam() {
}

const std::string &OutputImageParam::name() const {
    return param.name();
}

Type OutputImageParam::type() const {
    return param.type();
}

bool OutputImageParam::defined() {
    return param.defined();
}

Expr OutputImageParam::min(int x) const {
    std::ostringstream s;
    s << name() << ".min." << x;
    return Internal::Variable::make(Int(32), s.str(), param);<commit_msg>bool OutputImageParam::defined() => bool OutputImageParam::defined() const<commit_after>#include "Param.h"


namespace Halide {

void OutputImageParam::add_implicit_args_if_placeholder(std::vector<Expr> &args,
                                                        Expr last_arg,
                                                        int total_args,
                                                        bool *placeholder_seen) const {
    const Internal::Variable *var = last_arg.as<Internal::Variable>();
    bool is_placeholder = var && Var::is_placeholder(var->name);
    if (is_placeholder) {
        user_assert(!(*placeholder_seen))
            << "Only one implicit placeholder ('_') allowed in argument list for ImageParam " << name() << "\n";
        *placeholder_seen = true;

        // The + 1 in the conditional is because one provided argument is an placeholder
        for (int i = 0; i < (dimensions() - total_args + 1); i++) {
            args.push_back(Var::implicit(i));
        }
    } else {
        args.push_back(last_arg);
    }
}

OutputImageParam::OutputImageParam(const Internal::Parameter &p) :
    param(p) {
}

OutputImageParam::~OutputImageParam() {
}

const std::string &OutputImageParam::name() const {
    return param.name();
}

Type OutputImageParam::type() const {
    return param.type();
}

bool OutputImageParam::defined() const {
    return param.defined();
}

Expr OutputImageParam::min(int x) const {
    std::ostringstream s;
    s << name() << ".min." << x;
    return Internal::Variable::make(Int(32), s.str(), param);
{'fraction_non_alphanumeric': 0.13081679140904653, 'fraction_numerical': 0.0032541490400260333, 'mean_word_length': 2.3966850828729283, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1401207', 'n_tokens_mistral': 837, 'n_tokens_neox': 824, 'n_words': 200}