<commit_before>class Customer < ActiveRecord::Base
  belongs_to :provider
  belongs_to :address
  accepts_nested_attributes_for :address

  normalize_attribute :first_name, :with=> [:squish, :titleize]
  normalize_attribute :last_name, :with=> [:squish, :titleize]
  normalize_attribute :middle_initial, :with=> [:squish, :upcase]

  def name
    if group
      return "(Group) %s" % first_name
    end
    if middle_initial
      return "%s %s. %s" % [first_name, middle_initial, last_name]
    else
      return "%s %s " % [first_name, last_name]
    end
  end

  def age_in_years
    if birth_year.nil?
      return nil
    end
    today = Date.today
    years = today.year - birth_date.year #2011 - 1980 = 31
    if today.month < birth_year.month  || today.month == birth_year.month and today.day < birth_year.day #but 4/8 is before 7/3, so age is 30
      years -= 1
    end<commit_msg>empty is not nil<commit_after>class Customer < ActiveRecord::Base
  belongs_to :provider
  belongs_to :address
  accepts_nested_attributes_for :address

  normalize_attribute :first_name, :with=> [:squish, :titleize]
  normalize_attribute :last_name, :with=> [:squish, :titleize]
  normalize_attribute :middle_initial, :with=> [:squish, :upcase]

  def name
    if group
      return "(Group) %s" % first_name
    end
    if middle_initial.size > 0
      return "%s %s. %s" % [first_name, middle_initial, last_name]
    else
      return "%s %s " % [first_name, last_name]
    end
  end

  def age_in_years
    if birth_year.nil?
      return nil
    end
    today = Date.today
    years = today.year - birth_date.year #2011 - 1980 = 31
    if today.month < birth_year.month  || today.month == birth_year.month and today.day < birth_year.day #but 4/8 is before 7/3, so age is 30
      years -= 1
    end
{'fraction_non_alphanumeric': 0.10479375696767002, 'fraction_numerical': 0.01950947603121516, 'mean_word_length': 3.184149184149184, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '3356395', 'n_tokens_mistral': 647, 'n_tokens_neox': 607, 'n_words': 173}