<commit_before>
var CSDH_API = "http://localhost:5000"


module.exports = {
  retrieveDatasetDefinition: function(settings) {
    $.get(CSDH_API + '/dataset/definition',{'file': settings.filename}, function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  retrieveCommunityDimensions: function(settings) {
    $.get(CSDH_API + '/community/dimensions', function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  retrieveCommunitySchemes: function(settings) {
    $.get(CSDH_API + '/community/schemes', function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  saveDataset: function(settings) {
    $.post(CSDH_API + '/dataset/save',data=JSON.stringify({'dataset': settings.dataset}), function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  retrieveDimension: function(settings) {
    $.get(CSDH_API + '/community/definition', {'uri': settings.dimension}, function(dimension_details){
      console.log("QBerAPI retrieveDimension");
      console.log(dimension_details);
      if(dimension_details == 'error'){
        settings.error(settings.dimension);
      } else {
        settings.success(dimension_details);
      }
    }).fail(function(){
      settings.error(settings.dimension);
    });
  },

  retrieveCodes: function(settings) {
    $.get(CSDH_API + '/community/concepts', {'uri': settings.codelist_uri}, function(codes){
      console.log("QBerAPI retrieveCodes");
      console.log(codes);
      if(codes.response && codes.response == 'error'){
        settings.error(settings.codelist_uri);
      } else {
        settings.success(codes.codelist);
      }
    }).fail(function(){
      settings.error(settings.codelist_uri);
    });
  },

  retrieveFileList: function(settings) {
    $.get(CSDH_API + '/browse', {'path': settings.path}, function(data){
      console.log("QBerAPI retrieveFileList");
      console.log(data);
      if(data.response == 'error'){
        settings.error(settings.path);
      } else {
        settings.success(data);
      }
    }).fail(function(){
      settings.error(settings.path);
    });
  },

  retrieveIRI: function(settings) {
    $.get(CSDH_API + '/iri', {'iri': settings.iri}, function(data){
      console.log("QBerAPI retrieveIRI");
      console.log(data);
      if(data.response == 'error'){
        settings.error(settings.iri);
      } else {
        settings.success(data.response);
      }
    }).fail(function(){
      settings.error(settings.iri);
    });
  }
};<commit_msg>Correct dealing with responses, renamed retrieveCodes to retrieveConcepts<commit_after>
var CSDH_API = "http://localhost:5000"


module.exports = {
  retrieveDatasetDefinition: function(settings) {
    $.get(CSDH_API + '/dataset/definition',{'file': settings.filename}, function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  retrieveCommunityDimensions: function(settings) {
    $.get(CSDH_API + '/community/dimensions', function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  retrieveCommunitySchemes: function(settings) {
    $.get(CSDH_API + '/community/schemes', function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(){
      settings.error(response);
    });
  },

  saveDataset: function(settings) {
    $.post(CSDH_API + '/dataset/save',data=JSON.stringify({'dataset': settings.dataset}), function(response){
      console.log(response);
      settings.success(response);
    }).fail(function(response){
      settings.error(response);
    });
  },

  retrieveDimension: function(settings) {
    $.get(CSDH_API + '/community/definition', {'uri': settings.dimension}, function(response){
      console.log("QBerAPI retrieveDimension");
      console.log(response);
      settings.success(response);
    }).fail(function(response){
      settings.error(response);
    });
  },

  retrieveConcepts: function(settings) {
    $.get(CSDH_API + '/community/concepts', {'uri': settings.scheme_uri}, function(response){
      console.log("QBerAPI retrieveConcepts");
      settings.success(response);
    }).fail(function(response){
      settings.error(response);
    });
  },

  retrieveFileList: function(settings) {
    $.get(CSDH_API + '/browse', {'path': settings.path}, function(response){
      console.log("QBerAPI retrieveFileList");
      console.log(response);
      settings.success(response);
    }).fail(function(response){
      settings.error(response);
    });
  },

  retrieveIRI: function(settings) {
    $.get(CSDH_API + '/iri', {'iri': settings.iri}, function(response){
      console.log("QBerAPI retrieveIRI");
      console.log(response);
      settings.success(response);
    }).fail(function(response){
      settings.error(response);
    });
  }
};
{'fraction_non_alphanumeric': 0.1662857142857143, 'fraction_numerical': 0.0015238095238095239, 'mean_word_length': 3.488034188034188, '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': '5770223', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1543, 'n_words': 213}