<commit_before>// Backbone Extensions
// ===================

// Version 0.1.0

// Allow an object to translate a concrete event, such as a click,
// into an abstract event that its listeners can act on.
// Example use in an events hash:
// 'click .draw-graph': Backbone.proxy('redraw')

Backbone.proxy = function(event_name) {
  return function() { this.trigger(event_name); };
};

//= Controller =

// An alias for View, for semantic clarity.
Backbone.Controller = Backbone.View.extend({});

//= getModelName =

// Extend Backbone models to enable getting the model name from the urlRoot.
Backbone.Model.prototype.getModelName = function() {
  return this.urlRoot.replace(/api\//g, '').replace(/[s]*\//g, '');
};

//= toDisplay =

// Extend Backbone models to add `toDisplay`, similar to `toJSON`,
// except it handles `moment` format objects nicely.
// Can be given a `date_format` in the `options` hash.
Backbone.Model.prototype.toDisplay = function(options) {
  options || (options = {});
  var cloned_attrs, date_format;
  cloned_attrs = _.clone(this.attributes);<commit_msg>Add link to github in JS module<commit_after>// Backbone Extensions
// ===================

// Version 0.1.0
// See `github <https://github.com/sprin/backbone_ext>`_ for latest source.

// Allow an object to translate a concrete event, such as a click,
// into an abstract event that its listeners can act on.
// Example use in an events hash:
// 'click .draw-graph': Backbone.proxy('redraw')

Backbone.proxy = function(event_name) {
  return function() { this.trigger(event_name); };
};

//= Controller =

// An alias for View, for semantic clarity.
Backbone.Controller = Backbone.View.extend({});

//= getModelName =

// Extend Backbone models to enable getting the model name from the urlRoot.
Backbone.Model.prototype.getModelName = function() {
  return this.urlRoot.replace(/api\//g, '').replace(/[s]*\//g, '');
};

//= toDisplay =

// Extend Backbone models to add `toDisplay`, similar to `toJSON`,
// except it handles `moment` format objects nicely.
// Can be given a `date_format` in the `options` hash.
Backbone.Model.prototype.toDisplay = function(options) {
  options || (options = {});
  var cloned_attrs, date_format;
  cloned_attrs = _.clone(this.attributes);
{'fraction_non_alphanumeric': 0.15913120567375885, 'fraction_numerical': 0.0026595744680851063, 'mean_word_length': 3.8852813852813854, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '7411851', 'n_tokens_mistral': 690, 'n_tokens_neox': 679, 'n_words': 219}