<commit_before>// (C) 2014 <NAME>

#pragma once

#include <utility>

template <class Iterator>
class iterator_pair {
public:
  iterator_pair(std::pair<Iterator, Iterator> p_) : p(p_) { }
  Iterator begin() { return p.first; }
  Iterator end() { return p.second; }
private:
  std::pair<Iterator, Iterator> p;
};

template <class Iterator>
iterator_pair<Iterator> range(std::pair<Iterator, Iterator> p) {
  return iterator_pair<Iterator>(p);
}<commit_msg>option to iterate in random order<commit_after>// (C) 2014 <NAME>

#pragma once

#include <algorithm>
#include <vector>
#include <utility>

template <class Iterator>
class iterator_pair {
public:
  iterator_pair(std::pair<Iterator, Iterator> p_) : p(p_) { }
  Iterator begin() { return p.first; }
  Iterator end() { return p.second; }
private:
  std::pair<Iterator, Iterator> p;
};

template <class Iterator>
iterator_pair<Iterator> range(std::pair<Iterator, Iterator> p) {
  return iterator_pair<Iterator>(p);
}

template <class Iterator>
auto shuffled(std::pair<Iterator, Iterator> p) -> std::vector<decltype(*p.first)> {
  std::vector<decltype(*p.first)> R(p.first, p.second);
  std::random_shuffle(R.begin(), R.end());
  return R;
}
{'fraction_non_alphanumeric': 0.159798149705635, 'fraction_numerical': 0.00672834314550042, 'mean_word_length': 5.761363636363637, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 28, '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': '6901434', 'n_tokens_mistral': 423, 'n_tokens_neox': 408, 'n_words': 102}