<commit_before>module PaygHelper
  def payg_options(account)
    @account = account
    @amounts = Payg::VALID_TOP_UP_AMOUNTS
    balance_option = add_option_to_pay_off_balance
    options = @amounts.map { |amount| ["$#{amount} USD", amount] }
    options[0][0] = "#{options[0][0]} (Outstanding balance)" if balance_option
    options_for_select options, @amounts.first
  end

  def add_option_to_pay_off_balance
    remaining_balance = (Invoice.milli_to_cents @account.remaining_balance) / 100.0
    return false unless remaining_balance > 0
    remaining_balance = format '%.2f', remaining_balance
    @amounts.unshift remaining_balance
  end
end
<commit_msg>Fixed duplicate entries in wallet top-up options<commit_after>module PaygHelper
  def payg_options(account)
    @account = account
    @amounts = Payg::VALID_TOP_UP_AMOUNTS.dup
    balance_option = add_option_to_pay_off_balance
    options = @amounts.map { |amount| ["$#{amount} USD", amount] }
    options[0][0] = "#{options[0][0]} (Outstanding balance)" if balance_option
    options_for_select options, @amounts.first
  end

  def add_option_to_pay_off_balance
    remaining_balance = (Invoice.milli_to_cents @account.remaining_balance) / 100.0
    return false unless remaining_balance > 0
    remaining_balance = format '%.2f', remaining_balance
    @amounts.unshift remaining_balance
  end
end

{'fraction_non_alphanumeric': 0.09551800146950772, 'fraction_numerical': 0.014695077149155033, 'mean_word_length': 4.7957446808510635, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4792231', 'n_tokens_mistral': 451, 'n_tokens_neox': 442, 'n_words': 96}