<commit_before>define([
  'lib/underscore',
  'lib/backbone',
  'component/grid/projection/base',
], function (_, Backbone, BaseProjection) {
  var Model = BaseProjection.extend({
    defaults: {
      'row.classes': {},
    },
    name: 'row',
    update: function (options) {
      if (Model.__super__.update.call(this, options)) {
        var model = this.src.data;
        var rows = model.get('value');

        _.each(rows, row => {
          var type = _.chain(row).result('$metadata').result('type').value();

          if (_.isUndefined(type)) {
            row.$metadata = _.extend({}, row.$metadata, {
              type: 'row',
            });
          }
        });

        _.each(rows, (row) => {
          var classArr = [];
          var classesRule = this.get('row.classes');

          var checkId = this.get('row.check.id');
          var checkboxAllow = model.get('row.check.allow');

          _.each(classesRule, (func, key) => {
            var originClass = _.chain(row)
              .result('$metadate')
              .result('attr')
              .result('class')
              .value();

            if (originClass) {
              classArr.push(originClass);
            }

            var type = _.chain(row).result('$metadata').result('type').value();

            if (_.isFunction(func) && func(row, type)) {
              classArr.push(key);
            }
          });
          
          //attr info from meta 
          var originId = _.chain(row)
            .result('$metadate')
            .result('attr')
            .result('id')
            .value();

          if (_.isFunction(checkboxAllow) ? checkboxAllow(row) : checkboxAllow) {
            var uniqueId = model.get('a11y.selection.uniqueId');
            var id = row[checkId] || originId;
            var a11yId = uniqueId.concat(id);
            var role = 'row';
          }

          _.extend(row, {
            $metadata: {
              attr: _.pick({
                class: _.flatten(classArr).join(' '),
                id: a11yId,
                role: role,
              }, Boolean),
            },
          });
        });

        this.patch({ value: rows });
      }
    },
  });

  return Model;
});
<commit_msg>fix class conflict between projections (row.js and map.js)<commit_after>define([
  'lib/underscore',
  'lib/backbone',
  'component/grid/projection/base',
], function (_, Backbone, BaseProjection) {
  var Model = BaseProjection.extend({
    defaults: {
      'row.classes': {},
    },
    name: 'row',
    update: function (options) {
      if (Model.__super__.update.call(this, options)) {
        var model = this.src.data;
        var rows = model.get('value');

        _.each(rows, row => {
          var type = _.chain(row).result('$metadata').result('type').value();

          if (_.isUndefined(type)) {
            row.$metadata = _.extend({}, row.$metadata, {
              type: 'row',
            });
          }
        });

        _.each(rows, (row) => {
          var classArr = [];
          var originClass = _.chain(row)
            .result('$metadata')
            .result('attr')
            .result('class')
            .value();

          if (originClass) {
            classArr.push(originClass);
          }

          var classesRule = this.get('row.classes');

          var checkId = this.get('row.check.id');
          var checkboxAllow = model.get('row.check.allow');

          _.each(classesRule, (func, key) => {
            var type = _.chain(row).result('$metadata').result('type').value();

            if (_.isFunction(func) && func(row, type)) {
              classArr.push(key);
            }
          });

          //attr info from meta 
          var originId = _.chain(row)
            .result('$metadate')
            .result('attr')
            .result('id')
            .value();

          if (_.isFunction(checkboxAllow) ? checkboxAllow(row) : checkboxAllow) {
            var uniqueId = model.get('a11y.selection.uniqueId');
            var id = row[checkId] || originId;
            var a11yId = uniqueId.concat(id);
            var role = 'row';
          }

          _.extend(row, {
            $metadata: {
              attr: _.pick({
                class: _.flatten(classArr).join(' '),
                id: a11yId,
                role: role,
              }, Boolean),
            },
          });
        });

        this.patch({ value: rows });
      }
    },
  });

  return Model;
});

{'fraction_non_alphanumeric': 0.15933943316224058, 'fraction_numerical': 0.0026779736665922785, 'mean_word_length': 1.4955456570155903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6773765', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1256, 'n_words': 239}