<commit_before>import Ember from 'ember';
import config from 'ember-charts/config/environment';

export default Ember.Controller.extend({
  activeDataset: Ember.inject.service(),

  actions: {
    requestDataset(datasetDescription) {
      // let url = `${config.apiHost}/${config.apiPrefix}`;
      // url += datasetDescription.get('isBidimensional')
      //       ? '/unidimensional_datasets'
      //       : '/bidimensional_datasets';
      // url += datasetDescription;
      // Ember.$.ajax(url).then(dataset => {
      //   let modelName;
      //   if (datasetDescription.get('isUnidimensional')) {
      //     modelName = 'unidimensionalDataset';
      //   } else {
      //     modelName = 'bidimensionalDataset';
      //   }
      //   this.store.create(modelName, dataset);
      // })
    },

    uploadDocument(file) {
      let formData = new FormData();
      formData.append('file', file[0]);

      this.toggleProperty('isFileUploading');

      Ember.$.ajax({
        url: `${config.apiHost}/${config.apiPrefix}/documents/upload`,
        data: formData,
        type: 'POST',
        contentType: false,
        processData: false
      }).always(() => {
        this.toggleProperty('isFileUploading');
      });
    }
  }
});<commit_msg>Shows "upload successll"<commit_after>import Ember from 'ember';
import config from 'ember-charts/config/environment';

export default Ember.Controller.extend({
  activeDataset: Ember.inject.service(),

  actions: {
    requestDataset(datasetDescription) {
      // let url = `${config.apiHost}/${config.apiPrefix}`;
      // url += datasetDescription.get('isBidimensional')
      //       ? '/unidimensional_datasets'
      //       : '/bidimensional_datasets';
      // url += datasetDescription;
      // Ember.$.ajax(url).then(dataset => {
      //   let modelName;
      //   if (datasetDescription.get('isUnidimensional')) {
      //     modelName = 'unidimensionalDataset';
      //   } else {
      //     modelName = 'bidimensionalDataset';
      //   }
      //   this.store.create(modelName, dataset);
      // })
    },

    uploadDocument(file) {
      let formData = new FormData();
      formData.append('file', file[0]);

      this.toggleProperty('isFileUploading');

      Ember.$.ajax({
        url: `${config.apiHost}/${config.apiPrefix}/documents/upload`,
        data: formData,
        type: 'POST',
        contentType: false,
        processData: false
      })
      .then(resp => {
        this.set('didUploadedSuccessfully', true);
      }, error => {
        this.set('didUploadedSuccessfully', false);
      })
      .always(() => {
        this.toggleProperty('isFileUploading');
      });
    }
  }
});
{'fraction_non_alphanumeric': 0.15949554896142434, 'fraction_numerical': 0.000741839762611276, 'mean_word_length': 2.30920245398773, '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': '3602654', 'n_tokens_mistral': 799, 'n_tokens_neox': 788, 'n_words': 122}