<commit_before>import humanizeDuration from 'humanize-duration';
import {extend} from 'underscore';
import $ from 'jquery';

class Model {

  constructor(options) {    
    const defaultOptions = {
      parse: true
    };

    this.options = extend(defaultOptions, options);
    this.fetch = this.fetch.bind(this);
  }

  parse() {}

  fetch() {
    this.data = {};
    const promise = $.ajax({
      url: this.options.url || this.url(),
      type: this.options.type || 'GET',
      dataType: this.options.dataType || 'json'
    });

    promise.done((data, textStatus, jqXHR) => {
      this.data = data;
      this.textStatus = textStatus;
      this.jqXHR = jqXHR;<commit_msg>resetting data before fetch causes issues<commit_after>import humanizeDuration from 'humanize-duration';
import {extend} from 'underscore';
import $ from 'jquery';

class Model {

  constructor(options) {    
    const defaultOptions = {
      parse: true
    };

    this.options = extend(defaultOptions, options);
    this.fetch = this.fetch.bind(this);
  }

  parse() {}

  fetch() {    
    const promise = $.ajax({
      url: this.options.url || this.url(),
      type: this.options.type || 'GET',
      dataType: this.options.dataType || 'json'
    });

    promise.done((data, textStatus, jqXHR) => {
      this.data = data;
      this.textStatus = textStatus;
      this.jqXHR = jqXHR;
{'fraction_non_alphanumeric': 0.1433770014556041, 'fraction_numerical': 0.0, 'mean_word_length': 2.8194444444444446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '653109', 'n_tokens_mistral': 441, 'n_tokens_neox': 427, 'n_words': 97}