<commit_before>(function poll() {
  if (typeof ynabToolKit !== 'undefined' && ynabToolKit.pageReady === true) {
    ynabToolKit.enhancedSelectedTotals = (function () {
      function calculateSelectedTotal(accountsController) {
        var total = 0;
        var transactions = accountsController.get('areChecked');

        transactions.forEach(function (transaction) {
          if (transaction.inflow) {
            total += transaction.inflow;
          } else {
            total -= transaction.outflow;
          }
        });

        return total;
      }

      function addSelectedTotalContainer() {
        if ($('.ynab-toolkit-selected-total').length === 0) {
          $('<div class="ynab-toolkit-selected-total">' +
              '<div class="accounts-header-balances-label" title="The total of the current selected transactions.">Selected Total</div>' +
            '</div>').appendTo('.accounts-header-balances');
        }
      }

      function updateSelectedTotal(accountsController) {
        Ember.run.next(function () {
          addSelectedTotalContainer();

          var areChecked = accountsController.get('areChecked');

          if (areChecked.length === 0) {
            return $('.ynab-toolkit-selected-total').hide();
          }

          $('.ynab-toolkit-selected-total').show();
          $('.ynab-toolkit-selected-total .currency-container').remove();

          var total = calculateSelectedTotal(accountsController);
          var formattedCurrency = ynabToolKit.shared.formatCurrency(total);
          var userData = $('<span>', { class: 'user-data currency-container', title: formattedCurrency });
          var userCurrency = $('<span>', { class: 'user-data currency' });

          if (total < 0) {
            userCurrency.addClass('negative');
          } else {
            userCurrency.addClass('positive');
          }

          ynabToolKit.shared.appendFormattedCurrencyHtml(userCurrency, total);
          userCurrency.appendTo(userData);
          userData.appendTo($('.ynab-toolkit-selected-total'));
        });
      }

      return {
        invoke: function () {
          var accounts = ynabToolKit.shared.containerLookup('controller:accounts');
          accounts.addObserver('areChecked', updateSelectedTotal);
        }
      };
    }());

    ynabToolKit.enhancedSelectedTotals.invoke();
  } else {
    setTimeout(poll, 250);
  }
}());<commit_msg>add the count of selected tranasctions<commit_after>(function poll() {
  if (typeof ynabToolKit !== 'undefined' && ynabToolKit.pageReady === true) {
    ynabToolKit.enhancedSelectedTotals = (function () {
      function calculateSelectedTotal(accountsController) {
        var total = 0;
        var transactions = accountsController.get('areChecked');

        transactions.forEach(function (transaction) {
          if (transaction.inflow) {
            total += transaction.inflow;
          } else {
            total -= transaction.outflow;
          }
        });

        return total;
      }

      function addSelectedTotalContainer() {
        if ($('.ynab-toolkit-selected-total').length === 0) {
          $('<div class="ynab-toolkit-selected-total">' +
              '<div id="ynab-toolkit-selected-total-message" class="accounts-header-balances-label" title="The total of the current selected transactions."></div>' +
            '</div>').appendTo('.accounts-header-balances');
        }
      }

      function updateSelectedTotal(accountsController) {
        Ember.run.next(function () {
          addSelectedTotalContainer();

          let areChecked = accountsController.get('areChecked');

          if (areChecked.length === 0) {
            return $('.ynab-toolkit-selected-total').hide();
          }

          $('.ynab-toolkit-selected-total').show();
          $('.ynab-toolkit-selected-total .currency-container').remove();

          let message = areChecked.length + ' selected transaction' + (areChecked.length > 1 ? 's' : '') + ' totaling:';

          let total = calculateSelectedTotal(accountsController);
          let formattedCurrency = ynabToolKit.shared.formatCurrency(total);
          let userData = $('<span>', { class: 'user-data currency-container', title: formattedCurrency });
          let userCurrency = $('<span>', { class: 'user-data currency' });

          if (total < 0) {
            userCurrency.addClass('negative');
          } else {
            userCurrency.addClass('positive');
          }

          $('#ynab-toolkit-selected-total-message').text(message);

          ynabToolKit.shared.appendFormattedCurrencyHtml(userCurrency, total);
          userCurrency.appendTo(userData);
          userData.appendTo($('.ynab-toolkit-selected-total'));
        });
      }

      return {
        invoke: function () {
          let accounts = ynabToolKit.shared.containerLookup('controller:accounts');
          accounts.addObserver('areChecked', updateSelectedTotal);
        }
      };
    }());

    ynabToolKit.enhancedSelectedTotals.invoke();
  } else {
    setTimeout(poll, 250);
  }
}());
{'fraction_non_alphanumeric': 0.1410509679968392, 'fraction_numerical': 0.002963255630185697, 'mean_word_length': 2.4418762746431, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 16, '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': '825523', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1342, 'n_words': 223}