<commit_before>import Backbone from 'backbone';
import _ from 'underscore';
import $ from 'jquery';

import { ErrorBulletWidget } from './ErrorBulletWidget';

import tablePane from '../templates/tablePane';

export let ResultTablePane = Backbone.View.extend({
  el: '.result-table-pane',

  initialize: function (settings) {
    this.results = settings.percentErrorByDataset;
    this.algorithms = settings.algorithms || {};
    this.datasetMap = settings.datasetMap || {};
    this.trajectoryMap = settings.trajectoryMap || {};
    this.datasetLabelMap = settings.datasetLabelMap || {};
    if (this.results === undefined) {
      return;
    }
  },

  render: function () {
    if (this.result === undefined) {
      return;
    }
    // dots in names confound css selectors
    this.results.sort(function (a, b) {
      return a.dataset.localeCompare(b.dataset);
    });
    _.each(this.results, _.bind(function (result) {
      result.id = result.dataset.replace(/\./g, '_');
      this.datasetMap[result.id] = this.datasetMap[result.dataset];
      this.trajectoryMap[result.id] = this.trajectoryMap[result.dataset];
      this.datasetLabelMap[result.id] = this.datasetLabelMap[result.dataset];
    }, this));

    var resultsByDatasetId = _.groupBy(this.results, function (result) {
      return result.id;
    });

    this.$el.html(tablePane({
      resultsByDatasetId: resultsByDatasetId,
      algorithms: this.algorithms,<commit_msg>Fix typo in undefined check.<commit_after>import Backbone from 'backbone';
import _ from 'underscore';
import $ from 'jquery';

import { ErrorBulletWidget } from './ErrorBulletWidget';

import tablePane from '../templates/tablePane';

export let ResultTablePane = Backbone.View.extend({
  el: '.result-table-pane',

  initialize: function (settings) {
    this.results = settings.percentErrorByDataset;
    this.algorithms = settings.algorithms || {};
    this.datasetMap = settings.datasetMap || {};
    this.trajectoryMap = settings.trajectoryMap || {};
    this.datasetLabelMap = settings.datasetLabelMap || {};
    if (this.results === undefined) {
      return;
    }
  },

  render: function () {
    if (this.results === undefined) {
      return;
    }
    // dots in names confound css selectors
    this.results.sort(function (a, b) {
      return a.dataset.localeCompare(b.dataset);
    });
    _.each(this.results, _.bind(function (result) {
      result.id = result.dataset.replace(/\./g, '_');
      this.datasetMap[result.id] = this.datasetMap[result.dataset];
      this.trajectoryMap[result.id] = this.trajectoryMap[result.dataset];
      this.datasetLabelMap[result.id] = this.datasetLabelMap[result.dataset];
    }, this));

    var resultsByDatasetId = _.groupBy(this.results, function (result) {
      return result.id;
    });

    this.$el.html(tablePane({
      resultsByDatasetId: resultsByDatasetId,
      algorithms: this.algorithms,
{'fraction_non_alphanumeric': 0.14015151515151514, 'fraction_numerical': 0.0, 'mean_word_length': 3.455521472392638, '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': '2094606', 'n_tokens_mistral': 872, 'n_tokens_neox': 867, 'n_words': 167}