<commit_before><?
function Gather(array $t_args, array $inputs, array $outputs) {
    // Class name randomly generated
    $className = generate_name("Gather");

    $outputs = array_combine(array_keys($outputs), $inputs);

    $sys_headers  = ['vector'];
    $user_headers = [];
    $lib_headers  = [];
    $libraries    = [];
    $extra = [];
    $result_type = 'single'
?>

class <?=$className?>;

class <?=$className?> {
 public:
  using Tuple = std::tuple<<?=typed($inputs)?>>;

  using Vector = std::vector<Tuple>;

 private:
  // The container that gathers the input.
  Vector items;

  // The tuple to be filled with the current item.
  Tuple item;

  // Used for iterating over the container during GetNextResult.
  int return_counter;

 public:
  <?=$className?>(){}

  void AddItem(<?=const_typed_ref_args($inputs)?>) {
<?  foreach (array_keys($inputs) as $index => $name) { ?>
    std::get<<?=$index?>>(item) = <?=$name?>;
<?  } ?>
    items.push_back(item);
  }

  void AddState(<?=$className?>& other) {
    items.reserve(items.size() + other.items.size());
    items.insert(items.end(), other.items.begin(), other.items.end());
  }

  void Finalize() {
    return_counter = 0;
  }

  void GetResult(<?=typed_ref_args($outputs)?>, int index = 0) const {
<?  foreach (array_keys($outputs) as $index => $name) { ?>
    <?=$name?> = std::get<<?=$index?>>(items[index]);
<?  } ?>
  }

  int GetCount() const {
    return items.size();
  }

  const Vector& GetTuples() const {
    return items;
  }
};

<?
    return [
        'kind'           => 'GLA',
        'name'           => $className,
        'system_headers' => $sys_headers,
        'user_headers'   => $user_headers,
        'lib_headers'    => $lib_headers,
        'libraries'      => $libraries,
        'extra'          => $extra,
        'iterable'       => false,
        'input'          => $inputs,
        'output'         => $outputs,
        'result_type'    => $result_type,
    ];
}
?><commit_msg>Standardized API for property 'list'<commit_after><?
function Gather(array $t_args, array $inputs, array $outputs) {
    // Class name randomly generated
    $className = generate_name("Gather");

    $outputs = array_combine(array_keys($outputs), $inputs);

    $sys_headers  = ['vector'];
    $user_headers = [];
    $lib_headers  = [];
    $libraries    = [];
    $properties   = ['list'];
    $extra        = [];
    $result_type  = 'single'
?>

class <?=$className?>;

class <?=$className?> {
 public:
  using Tuple = std::tuple<<?=typed($inputs)?>>;

  using Vector = std::vector<Tuple>;

 private:
  // The container that gathers the input.
  Vector items;

  // The tuple to be filled with the current item.
  Tuple item;

  // Used for iterating over the container during GetNextResult.
  int return_counter;

 public:
  <?=$className?>(){}

  void AddItem(<?=const_typed_ref_args($inputs)?>) {
<?  foreach (array_keys($inputs) as $index => $name) { ?>
    std::get<<?=$index?>>(item) = <?=$name?>;
<?  } ?>
    items.push_back(item);
  }

  void AddState(<?=$className?>& other) {
    items.reserve(items.size() + other.items.size());
    items.insert(items.end(), other.items.begin(), other.items.end());
  }

  void Finalize() {
    return_counter = 0;
  }

  void GetResult(<?=typed_ref_args($outputs)?>, int index = 0) const {
<?  foreach (array_keys($outputs) as $index => $name) { ?>
    <?=$name?> = std::get<<?=$index?>>(items[index]);
<?  } ?>
  }

  int GetCount() const {
    return items.size();
  }

  const Vector& GetList() const {
    return items;
  }
};

<?
    return [
        'kind'           => 'GLA',
        'name'           => $className,
        'system_headers' => $sys_headers,
        'user_headers'   => $user_headers,
        'lib_headers'    => $lib_headers,
        'libraries'      => $libraries,
        'properties'     => $properties,
        'extra'          => $extra,
        'iterable'       => false,
        'input'          => $inputs,
        'output'         => $outputs,
        'result_type'    => $result_type,
    ];
}
?>
{'fraction_non_alphanumeric': 0.18586903003446578, 'fraction_numerical': 0.0009847365829640572, 'mean_word_length': 2.7241063244729604, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5495316', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1329, 'n_words': 282}