<commit_before>var module = angular.module('filters', []);
var Amount = ripple.Amount;

/**
 * Format a ripple.Amount.
 */
module.filter('rpamount', function () {
  return function (input, opts) {
    if ("number" === typeof opts) {
      opts = {
        precision: opts
      };
    } else if ("object" !== typeof opts) {
      opts = {};
    }
    if (!opts.precision) opts.precision = 0;

    if (!input) return "n/a";

    var amount = Amount.from_json(input);
    var out = amount.to_human(opts);

    return out;
  };
});

/**
 * Angular filter for Moment.js.
 *
 * Displays a timestamp as "x minutes ago".
 */
module.filter('rpfromnow', function () {
  return function (input) {
    return moment(input).fromNow();
  };
});<commit_msg>nickname filter<commit_after>var module = angular.module('filters', []);
var Amount = ripple.Amount;

/**
 * Format a ripple.Amount.
 */
module.filter('rpamount', function () {
  return function (input, opts) {
    if ("number" === typeof opts) {
      opts = {
        precision: opts
      };
    } else if ("object" !== typeof opts) {
      opts = {};
    }
    if (!opts.precision) opts.precision = 0;

    if (!input) return "n/a";

    var amount = Amount.from_json(input);
    var out = amount.to_human(opts);

    return out;
  };
});

/**
 * Angular filter for Moment.js.
 *
 * Displays a timestamp as "x minutes ago".
 */
module.filter('rpfromnow', function () {
  return function (input) {
    return moment(input).fromNow();
  };
});

/**
 * Show contact name or short address
 */
module.filter('rpnickname', function () {
  return function (address) {
    var nickname = rippleclient.id.getContact(address);

    if (!nickname) {
      nickname =  "" + address.substring(0,7) + "&hellip;";
    }

    return nickname;
  };
});
{'fraction_non_alphanumeric': 0.17059483726150393, 'fraction_numerical': 0.002244668911335578, 'mean_word_length': 2.8098290598290596, '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': '741656', 'n_tokens_mistral': 594, 'n_tokens_neox': 566, 'n_words': 146}