<commit_before>require 'git/duo/wrapper'
require 'pry'

module Git
  module Duo
    class Pair
      attr_reader :authors, :wrapper

      def initialize authors, opts = {}
        @authors = authors.sort_by {|author| author.key }
        @wrapper = opts.fetch(:wrapper) { Git::Duo::Wrapper.new File.join(Dir.pwd, '.git') }
      end

      def name
        authors.map(&:name).join ' + '
      end

      def email
        base_email.gsub "%names", authors.map(&:key).join(?+)
      end

      def to_s
        "#{name} <#{email}>"
      end
      alias_method :inspect, :to_s

      def save
        save_pair_name
        save_pair_email
      end

      private

      def base_email
        wrapper.config("git-duo.email").shift
      end<commit_msg>Replace shift with first<commit_after>require 'git/duo/wrapper'
require 'pry'

module Git
  module Duo
    class Pair
      attr_reader :authors, :wrapper

      def initialize authors, opts = {}
        @authors = authors.sort_by {|author| author.key }
        @wrapper = opts.fetch(:wrapper) { Git::Duo::Wrapper.new File.join(Dir.pwd, '.git') }
      end

      def name
        authors.map(&:name).join ' + '
      end

      def email
        base_email.gsub "%names", authors.map(&:key).join(?+)
      end

      def to_s
        "#{name} <#{email}>"
      end
      alias_method :inspect, :to_s

      def save
        save_pair_name
        save_pair_email
      end

      private

      def base_email
        wrapper.config("git-duo.email").first
      end
{'fraction_non_alphanumeric': 0.11834319526627218, 'fraction_numerical': 0.0, 'mean_word_length': 2.0198412698412698, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6468749', 'n_tokens_mistral': 502, 'n_tokens_neox': 481, 'n_words': 112}