<commit_before>
require 'flor/pcore/iterator'


class Flor::Pro::All < Flor::Pro::Iterator
  #
  # Returns true if all the elements in a collection return true
  # for the given function.
  #
  # ```
  # all? [ 1, 2, 3 ]
  #   def elt \ elt > 0
  #     #
  #     # yields true
  #
  # all? [ 1, 2, 3 ]
  #   def elt \ elt > 2
  #     #
  #     # yields false
  # ```
  #
  # ```
  # all? { a: 'A', b: 'B' }
  #   def key, val \ val == 'A' or val == 'B'
  #     #
  #     # yields true
  # ```
  #
  # ## see also
  #
  # Any?

  name 'all?'

  protected

  def receive_iteration

    # nothing to do
  end

  def function_mandatory?

    false
  end<commit_msg>Document "all?" without a function<commit_after>
require 'flor/pcore/iterator'


class Flor::Pro::All < Flor::Pro::Iterator
  #
  # Returns true if all the elements in a collection return true
  # for the given function.
  #
  # ```
  # all? [ 1, 2, 3 ]
  #   def elt \ elt > 0
  #     #
  #     # yields true
  #
  # all? [ 1, 2, 3 ]
  #   def elt \ elt > 2
  #     #
  #     # yields false
  # ```
  #
  # ```
  # all? { a: 'A', b: 'B' }
  #   def key, val \ val == 'A' or val == 'B'
  #     #
  #     # yields true
  # ```
  #
  # ### without a function
  #
  # ```
  # all? []                            # yields true
  # all? [ 1 2 3 ]                     # yields true
  # all? [ 1 false 3 ]                 # yields false
  # all? {}                            # yields true
  # all? { a: 'A', b: 'B', c: 'C' }    # yields true
  # all? { a: 'A', f: false, c: 'C' }  # yields false
  # ```
  #
  # ## see also
  #
  # Any?

  name 'all?'

  protected

  def receive_iteration

    # nothing to do
  end

  def function_mandatory?

    false
  end
{'fraction_non_alphanumeric': 0.15927654609101516, 'fraction_numerical': 0.012252042007001166, 'mean_word_length': 1.5673652694610778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4784577', 'n_tokens_mistral': 685, 'n_tokens_neox': 659, 'n_words': 186}