<commit_before>require 'highline'
require 'yaml'

require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib hitch author]))
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib hitch ui]))

module Hitch

  def self.print_info
    if Hitch.pairing? && STDOUT.tty?
      Hitch::UI.highline.say("#{Hitch.git_author_name} <#{Hitch.git_author_email}>")
    end
  end

  def self.export(pairs)
    Hitch.current_pair = pairs
    write_export_file
    print_info
  end

  def self.expire_command(time)
    %Q(sleep #{to_seconds(time)} && #{Hitch.bin_path} --unhitch&)
  end

  def self.unhitch
    Hitch.current_pair = []
    write_export_file
  end

  def self.author_command
    if Hitch.pairing?
      "export GIT_AUTHOR_NAME='#{Hitch.git_author_name}' GIT_AUTHOR_EMAIL='#{Hitch.git_author_email}'"
    else
      "unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL"
    end
  end

  def self.group_email
    config[:group_email] ||= Hitch::UI.prompt_for_group_email
  end

  def self.group_email=(email)
    config[:group_email] = email
    write_file
  end

  def self.current_pair
    config[:current_pair] ||= []
  end

  def self.current_pair=(pairs)
    config[:current_pair] = []
    pairs.each do |author|
      if Hitch::Author.find(author)
        config[:current_pair] << author
      else
        if new_author = Hitch::UI.prompt_for_pair(author)
          config[:current_pair] << author
        end
      end
    end
    write_file
  end

  def self.git_author_name
    devs = current_pair.sort.map {|pair| Hitch::Author.find(pair)}
    case devs.length
    when 1
      devs[0]
    when 2
      "#{devs[0]} and #{devs[1]}"
    else
      "#{devs[0...-1].join(', ')}, and #{devs[-1]}"
    end
  end

  def self.git_author_email
    "#{group_prefix}+#{current_pair.sort.join('+')}@#{group_domain}"
  end<commit_msg>Remove assigned but unused variable "new_author"<commit_after>require 'highline'
require 'yaml'

require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib hitch author]))
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib hitch ui]))

module Hitch

  def self.print_info
    if Hitch.pairing? && STDOUT.tty?
      Hitch::UI.highline.say("#{Hitch.git_author_name} <#{Hitch.git_author_email}>")
    end
  end

  def self.export(pairs)
    Hitch.current_pair = pairs
    write_export_file
    print_info
  end

  def self.expire_command(time)
    %Q(sleep #{to_seconds(time)} && #{Hitch.bin_path} --unhitch&)
  end

  def self.unhitch
    Hitch.current_pair = []
    write_export_file
  end

  def self.author_command
    if Hitch.pairing?
      "export GIT_AUTHOR_NAME='#{Hitch.git_author_name}' GIT_AUTHOR_EMAIL='#{Hitch.git_author_email}'"
    else
      "unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL"
    end
  end

  def self.group_email
    config[:group_email] ||= Hitch::UI.prompt_for_group_email
  end

  def self.group_email=(email)
    config[:group_email] = email
    write_file
  end

  def self.current_pair
    config[:current_pair] ||= []
  end

  def self.current_pair=(pairs)
    config[:current_pair] = []
    pairs.each do |author|
      if Hitch::Author.find(author)
        config[:current_pair] << author
      else
        if Hitch::UI.prompt_for_pair(author)
          config[:current_pair] << author
        end
      end
    end
    write_file
  end

  def self.git_author_name
    devs = current_pair.sort.map {|pair| Hitch::Author.find(pair)}
    case devs.length
    when 1
      devs[0]
    when 2
      "#{devs[0]} and #{devs[1]}"
    else
      "#{devs[0...-1].join(', ')}, and #{devs[-1]}"
    end
  end

  def self.git_author_email
    "#{group_prefix}+#{current_pair.sort.join('+')}@#{group_domain}"
  end
{'fraction_non_alphanumeric': 0.13378378378378378, 'fraction_numerical': 0.004324324324324324, 'mean_word_length': 3.2248858447488584, 'pattern_counts': {'":': 0, '<': 13, '<?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': '6456920', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1351, 'n_words': 245}