<commit_before>module Commands
  module ActiveModel
    def self.extended(base)
      base.class_eval do
        include ::ActiveModel::Conversion
        include ::ActiveModel::AttributeMethods
        include ::ActiveModel::Validations
        
        extend ::Rcqrs::Initializer        
        include Commands::ActiveModel
      end
    end

    def parse_date(date)
      return date if date.is_a?(DateTime)
      return nil if date.blank?
      DateTime.strptime(date, '%d/%m/%Y')
    end

    # Commands are never persisted
    def persisted?
      false
    end

    # def to_key
    #   nil
    # end
    # 
    # def to_model<commit_msg>Include Dates<commit_after>module Commands
  module ActiveModel
    def self.extended(base)
      base.class_eval do
        include ::ActiveModel::Conversion
        include ::ActiveModel::AttributeMethods
        include ::ActiveModel::Validations
        
        extend ::Rcqrs::Initializer        
        include Commands::ActiveModel
      end
    end

    def parse_date(date)
      return date.to_date if date.is_a?(Date) || date.is_a?(DateTime) || date.is_a?(ActiveSupport::TimeWithZone)
      return nil if date.blank?
      
      return DateTime.strptime(date, '%d/%m/%Y').to_date
    rescue
      return date
    end

    # Commands are never persisted
    def persisted?
      false
    end

    # def to_key
    #   nil
    # end
    # 
    # def to_model
{'fraction_non_alphanumeric': 0.08309859154929577, 'fraction_numerical': 0.0, 'mean_word_length': 2.178970917225951, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5602164', 'n_tokens_mistral': 423, 'n_tokens_neox': 415, 'n_words': 100}