<commit_before>[Date, Time, DateTime].each do |klass|
  klass.class_eval do
    ISO8601_DATE_FRAGMENTS = %w(%0*d %02d %02d)
    ISO8601_TIME_FRAGMENTS = %w(%02d %02d %02d)

    if method_defined?(:xmlschema)
      alias_method :xmlschema_without_precision, :xmlschema
    end
    
    def xmlschema
      iso8601
    end

    if method_defined?(:iso8601)
      alias_method :iso8601_without_precision, :iso8601
    end
    def iso8601
      precision = self.precision || 0
      format = ""
      if precision > DateTimePrecision::NONE
        # Add date part to format
        format << ISO8601_DATE_FRAGMENTS.take([3,self.precision].min).join('-')
      end

      if precision > DateTimePrecision::DAY
        format << "T#{ISO8601_TIME_FRAGMENTS.take(precision - 3).join(':')}"<commit_msg>Get rid of constant warnings<commit_after>module DateTimePrecision
  ISO8601_DATE_FRAGMENTS = %w(%0*d %02d %02d)
  ISO8601_TIME_FRAGMENTS = %w(%02d %02d %02d)
end

[Date, Time, DateTime].each do |klass|
  klass.class_eval do
    if method_defined?(:xmlschema)
      alias_method :xmlschema_without_precision, :xmlschema
    end
    
    def xmlschema
      iso8601
    end

    if method_defined?(:iso8601)
      alias_method :iso8601_without_precision, :iso8601
    end
    def iso8601
      precision = self.precision || 0
      format = ""
      if precision > DateTimePrecision::NONE
        # Add date part to format
        format << DateTimePrecision::ISO8601_DATE_FRAGMENTS.take([3,self.precision].min).join('-')
      end

      if precision > DateTimePrecision::DAY
        format << "T#{DateTimePrecision::ISO8601_TIME_FRAGMENTS.take(precision - 3).join(':')}"
{'fraction_non_alphanumeric': 0.10697115384615384, 'fraction_numerical': 0.06009615384615385, 'mean_word_length': 3.247448979591837, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '7647361', 'n_tokens_mistral': 629, 'n_tokens_neox': 549, 'n_words': 114}