<commit_before>class UpdateStatus < ActiveRecord::Base

  belongs_to :endpoint

  def self.record(endpoint_id, latest)
    status = UpdateStatus.new
    status[:endpoint_id] = endpoint_id
    status[:count] = latest[:count]
    status[:first] = latest[:first].nil? ? '' : latest[:first].map{ |k, v| v }.join('$')
    status[:last]  = latest[:last].nil?  ? '' : latest[:last].map{ |k, v| v }.join('$')
    status.save
    return status
  end

  def self.different?(previous, latest, logger: nil)
    log = Umakadata::Logging::Log.new
    logger.push log unless logger.nil?

    if previous.nil?
      log.result = 'The previous status is nothing'
      return true
    elsif latest.nil?
      log.result = 'The previous status and latest one are nothing'
      return true
    end

    if previous[:count] != latest[:count]
      log.result = "The previous statements count #{previous[:count]}, latest statements count #{latest[:count]}"
    elsif previous[:first] != latest[:first]
      log.result = "The previous first statement #{previous[:first]}, latest last statement #{latest[:first]}"
    elsif previous[:last] != latest[:last]
      log.result = "The previous last statement #{previous[:last]}, latest last statement  #{latest[:last]}"
    else
      log.result = 'There are no differences between previous statements and latest ones'
      return false
    end

    return true
  end

end<commit_msg>Cosmetic change<commit_after>class UpdateStatus < ActiveRecord::Base

  belongs_to :endpoint

  def self.record(endpoint_id, latest)
    status = UpdateStatus.new
    status[:endpoint_id] = endpoint_id
    status[:count] = latest[:count]
    status[:first] = latest[:first].nil? ? '' : latest[:first].map{ |k, v| v }.join('$')
    status[:last]  = latest[:last].nil?  ? '' : latest[:last].map{ |k, v| v }.join('$')
    status.save
    return status
  end

  def self.different?(previous, latest, logger: nil)
    log = Umakadata::Logging::Log.new
    logger.push log unless logger.nil?

    if previous.nil?
      log.result = 'The previous status is nothing'
      return true
    elsif latest.nil?
      log.result = 'The previous status and latest one are nothing'
      return true
    end

    if previous[:count] != latest[:count]
      log.result = "The previous statements count: #{previous[:count]}, latest statements count: #{latest[:count]}"
    elsif previous[:first] != latest[:first]
      log.result = "The previous first statement: #{previous[:first]}, latest last statement: #{latest[:first]}"
    elsif previous[:last] != latest[:last]
      log.result = "The previous last statement: #{previous[:last]}, latest last statement: #{latest[:last]}"
    else
      log.result = 'There are no differences between previous statements and latest ones'
      return false
    end

    return true
  end

end
{'fraction_non_alphanumeric': 0.13512557481429077, 'fraction_numerical': 0.0, 'mean_word_length': 3.5103668261562997, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5427085', 'n_tokens_mistral': 821, 'n_tokens_neox': 811, 'n_words': 250}