<commit_before>(function (_, Backbone) {
    'use strict';


    Backbone.Siren.validate = {
        customPatterns: {}

        , standardPatterns: {}

        /**
         *
         * @param {Object} patterns
         */
        , setPatterns: function (patterns) {
            var self = this
            , validInputTypes = 'color date datetime datetime-local email month number range search tel time url week';

            _.each(patterns, function (pattern, name) {
                if (validInputTypes.indexOf(name) == -1) {
                    self.customPatterns[name] = pattern;
                } else {
                    self.standardPatterns[name] = pattern;
                }
            });
        }
    };


    _.extend(Backbone.Siren.Model.prototype, {


        /**
         * Override the default _validate method so we only get changed attributes instead of all attributes
         * More info: https://github.com/documentcloud/backbone/pull/1595
         *
         * @param {Object} attrs
         * @param {Object} options
         * @return {Boolean}
         * @private
         */
        _validate: function (attrs, options) {
            var error;

            if (!options.validate || !this.validate) {
                return true;
            }

            // This is the line that we are removing from the default implementation
            // attrs = _.extend({}, this.attributes, attrs);

            // We are also removing the "attributes" parameter and only passing in an options parameter
            error = this.validationError = this.validate(options.actionName, options) || null;
            if (!error) {
                return true;
            }

            this.trigger('invalid', this, error, options || {});
            return false;<commit_msg>minor<commit_after>(function (_, Backbone) {
    'use strict';


    Backbone.Siren.validate = {
        customPatterns: {}

        , standardPatterns: {}

        /**
         *
         * @param {Object} patterns
         */
        , setPatterns: function (patterns) {
            var self = this
            , validInputTypes = 'color date datetime datetime-local email month number range search tel time url week';

            _.each(patterns, function (pattern, name) {
                if (validInputTypes.indexOf(name) == -1) {
                    self.customPatterns[name] = pattern;
                } else {
                    self.standardPatterns[name] = pattern;
                }
            });
        }
    };


    _.extend(Backbone.Siren.Model.prototype, {


        /**
         * Override the default _validate method so we only get changed attributes instead of all attributes
         * More info: https://github.com/documentcloud/backbone/pull/1595
         *
         * @param {Object} attrs
         * @param {Object} options
         * @return {Boolean}
         * @private
         */
        _validate: function (attrs, options) {
            var error;

            if (! (options.validate && this.validate)) {
                return true;
            }

            // This is the line that we are removing from the default implementation
            // attrs = _.extend({}, this.attributes, attrs);

            // We are also removing the "attributes" parameter and only passing in an options parameter
            error = this.validationError = this.validate(options.actionName, options) || null;
            if (!error) {
                return true;
            }

            this.trigger('invalid', this, error, options || {});
            return false;
{'fraction_non_alphanumeric': 0.10217149220489978, 'fraction_numerical': 0.0027839643652561247, 'mean_word_length': 1.5701001430615165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '946829', 'n_tokens_mistral': 906, 'n_tokens_neox': 861, 'n_words': 251}