<commit_before>module AddressBook
  class Person
    attr_reader :attributes, :error, :ab_person

    def initialize(attributes={}, existing_ab_person = nil)
      @attributes = attributes
      if existing_ab_person.nil?
        @new_record = true
      else
        @ab_person = existing_ab_person
        load_ab_person
        @new_record = false
      end
    end

    def self.all
      address_book = ABAddressBookCreate()
      ABAddressBookCopyArrayOfAllPeople(address_book).map do |ab_person|
        new({}, ab_person)
      end
    end

    def self.create(attributes)<commit_msg>Added alphabetical sort by default<commit_after>module AddressBook
  class Person
    attr_reader :attributes, :error, :ab_person

    def initialize(attributes={}, existing_ab_person = nil)
      @attributes = attributes
      if existing_ab_person.nil?
        @new_record = true
      else
        @ab_person = existing_ab_person
        load_ab_person
        @new_record = false
      end
    end

    def self.all
      address_book = ABAddressBookCreate()
      people = ABAddressBookCopyArrayOfAllPeople(address_book).map do |ab_person|
        new({}, ab_person)
      end
      people.sort! { |a,b| "#{a.first_name} #{a.last_name}" <=> "#{b.first_name} #{b.last_name}" }
      people
    end

    def self.create(attributes)
{'fraction_non_alphanumeric': 0.08672699849170437, 'fraction_numerical': 0.0, 'mean_word_length': 2.7698863636363638, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7531598', 'n_tokens_mistral': 403, 'n_tokens_neox': 394, 'n_words': 89}