<commit_before># Raised when an object fails a validation test.
class ValidationError < RuntimeError; end

class Object
  # Returns whether this object is nil, false, empty, or a whitespace string.
  # For example, "", "   ", +nil+, [], and {} are blank.
  #
  # This method is borrowed from Rails ActiveSupport.
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end

  # Returns whether this object is nil, empty, or a whitespace string.
  # For example, "", "   ", +nil+, [], and {} return +true+.
  #
  # This method differs from blank? in that +false+ is an allowed value.
  def nil_or_empty?
    nil? or (respond_to?(:empty?) and empty?)
  end
end<commit_msg>Clarify nil_or_empty?.<commit_after># Raised when an object fails a validation test.
class ValidationError < RuntimeError; end

class Object
  # Returns whether this object is nil, false, empty, or a whitespace string.
  # This method is borrowed from Rails ActiveSupport.
  #
  # @example
  #   ''.blank? => true
  #   nil.blank? => true
  #   false.blank? => true
  #   [].blank? => true
  #   [[]].blank? => false
  # @return [Boolean] whether this object is nil, false, empty, or a whitespace string
  # @see {#nil_or_empty?}
  def blank?
    respond_to?(:empty?) ? empty? : !self
  end

  # Returns whether this object is nil, empty, or a whitespace string.
  # This method differs from {#blank?} in that +false+ is an allowed value.
  #
  # @example
  #   ''.nil_or_empty? => true
  #   nil.nil_or_empty? => true
  #   false.nil_or_empty? => false
  # @return [Boolean] whether this object is nil, empty, or a whitespace string
  def nil_or_empty?
    blank? and self != false
  end
end
{'fraction_non_alphanumeric': 0.1190619362597715, 'fraction_numerical': 0.0, 'mean_word_length': 3.3446475195822454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '797003', 'n_tokens_mistral': 539, 'n_tokens_neox': 521, 'n_words': 200}