<commit_before>require 'rational' unless RUBY_VERSION >= '1.9.2'

class DateTime
  class << self
    # DateTimes aren't aware of DST rules, so use a consistent non-DST offset when creating a DateTime with an offset in the local zone
    def local_offset
      ::Time.local(2007).utc_offset.to_r / 86400
    end

    def current
      ::Time.zone_default ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
    end
  end

  # Tells whether the DateTime object's datetime lies in the past
  def past?
    self < ::DateTime.current
  end

  # Tells whether the DateTime object's datetime lies in the future
  def future?
    self > ::DateTime.current
  end

  # Seconds since midnight: DateTime.now.seconds_since_midnight
  def seconds_since_midnight
    sec + (min * 60) + (hour * 3600)
  end<commit_msg>date_time/calculations.rb needs active_support/core_ext/object/acts_like because it uses acts_like?<commit_after>require 'rational' unless RUBY_VERSION >= '1.9.2'
require 'active_support/core_ext/object/acts_like'

class DateTime
  class << self
    # DateTimes aren't aware of DST rules, so use a consistent non-DST offset when creating a DateTime with an offset in the local zone
    def local_offset
      ::Time.local(2007).utc_offset.to_r / 86400
    end

    def current
      ::Time.zone_default ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
    end
  end

  # Tells whether the DateTime object's datetime lies in the past
  def past?
    self < ::DateTime.current
  end

  # Tells whether the DateTime object's datetime lies in the future
  def future?
    self > ::DateTime.current
  end

  # Seconds since midnight: DateTime.now.seconds_since_midnight
  def seconds_since_midnight
    sec + (min * 60) + (hour * 3600)
  end
{'fraction_non_alphanumeric': 0.08070978820835718, 'fraction_numerical': 0.0206067544361763, 'mean_word_length': 3.4478371501272265, 'pattern_counts': {'":': 0, '<': 9, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6202905', 'n_tokens_mistral': 573, 'n_tokens_neox': 532, 'n_words': 179}