<commit_before>// definitions
GlobalTemplates = (_.isUndefined(GlobalTemplates)) ? {} : GlobalTemplates;

/* GLOBAL HELPERS
.................................................*/

GlobalTemplates.useHelpers = function(Template) {
  Template.registerHelper('withIndex', function (all) {
    return _.map(all, function(val, index) {
        return {index: index, value: val};
    });
  });

  Template.registerHelper('timestampToDate', function(date) {
    if (_.isDate(date)) {
      return new Date(date);
    }
  });

  Template.registerHelper('centsToDollars', function(cents) {
      if (_.isNumber(cents)) {
        return parseFloat(cents / 100).toFixed(2);
      }
  });
};<commit_msg>fixes for client package<commit_after>
Template.registerHelper('withIndex', function (all) {
  return _.map(all, function(val, index) {
      return {index: index, value: val};
  });
});

Template.registerHelper('timestampToDate', function(date) {
  if (_.isDate(date)) {
    return new Date(date);
  }
});

Template.registerHelper('centsToDollarsLabel', function(cents) {
  var symbol = '$';

  cents = _.isNumber(cents) ? cents: 0;

  return symbol + parseFloat(cents / 100).toFixed(2);
});

Template.registerHelper('centsToDollars', function(cents, with_symbol) {
  var symbol = '';

  if (_.isBoolean(with_symbol) && with_symbol) {
    symbol = '$';
  }

  if (_.isNumber(cents)) {
    return symbol + parseFloat(cents / 100).toFixed(2);
  }
});
{'fraction_non_alphanumeric': 0.19206680584551147, 'fraction_numerical': 0.009046624913013222, 'mean_word_length': 3.411042944785276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '121407', 'n_tokens_mistral': 474, 'n_tokens_neox': 446, 'n_words': 85}