<commit_before>library more.iterable.window;

/// Sliding window over an iterable.
///
/// The following expression yields [1, 2, 3], [2, 3, 4], [3, 4, 5]:
///
///     window([1, 2, 3, 4, 5], 2);
Iterable<List<E>> window<E>(Iterable<E> elements, int size,
    {int step = 1, bool includePartial = false}) sync* {
  if (size < 1) {
    throw RangeError.value(size, 'size', 'size must be positive');
  }
  if (step < 1) {
    throw RangeError.value(step, 'step', 'step must be positive');
  }
  final current = <E>[];
  final iterator = elements.iterator;
  for (;;) {
    while (current.length < size && iterator.moveNext()) {
      current.add(iterator.current);<commit_msg>Fix the comment of window.<commit_after>library more.iterable.window;

/// Sliding window of given `size` over an iterable.
///
/// The following expression yields [1, 2, 3], [2, 3, 4], [3, 4, 5]:
///
///     window([1, 2, 3, 4, 5], 2);
Iterable<List<E>> window<E>(Iterable<E> elements, int size,
    {int step = 1, bool includePartial = false}) sync* {
  if (size < 1) {
    throw RangeError.value(size, 'size', 'size must be positive');
  }
  if (step < 1) {
    throw RangeError.value(step, 'step', 'step must be positive');
  }
  final current = <E>[];
  final iterator = elements.iterator;
  for (;;) {
    while (current.length < size && iterator.moveNext()) {
      current.add(iterator.current);
{'fraction_non_alphanumeric': 0.18373275236020334, 'fraction_numerical': 0.026143790849673203, 'mean_word_length': 3.292834890965732, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 13, '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': '1334547', 'n_tokens_mistral': 492, 'n_tokens_neox': 463, 'n_words': 146}