<commit_before>/*jslint node: true */
/*jshint laxbreak: true */
"use strict";

var $ = require('jquery');
var _ = require('underscore');
var Evidence = require('./Evidence');

var DataLoader = function() {
    return {
        get: function(proxy, uniprotID) {
            var url = 'wwwdev.ebi.ac.uk/uniprot/services/restful/features/';
            if(!proxy) {
                url = 'https://' + url;
            }

            return $.ajax({
                url: proxy + url + uniprotID,
                //We need this dataType to set the Accept header correctly
                dataType: "json"
            }).done(function(d) {
                d.variants.features = DataLoader.processVariants(d);
                return DataLoader.processData(d);
            }).fail(function(e){
                return(e);
            });
        }, processData: function(d){
            var consecutive = 0;
            _.each(d, function(datum) {
                if (datum && datum.features) {
                    _.each(datum.features, function(feature) {
                        if (feature.variants) {
                            _.each(feature.variants, function(variant) {
                                variant.internalId = "ft_" + consecutive;
                                variant.type.label = variant.type.label.replace('_', ' ');
                                consecutive++;
                            });
                        } else {
                            feature.internalId = "ft_" + consecutive;
                            feature.type.label = feature.type.label.replace('_', ' ');
                            consecutive++;
                        }
                    });<commit_msg>Switching to production server<commit_after>/*jslint node: true */
/*jshint laxbreak: true */
"use strict";

var $ = require('jquery');
var _ = require('underscore');
var Evidence = require('./Evidence');

var DataLoader = function() {
    return {
        get: function(proxy, uniprotID) {
            var url = 'www.ebi.ac.uk/uniprot/services/restful/features/';
            if(!proxy) {
                url = 'https://' + url;
            }

            return $.ajax({
                url: proxy + url + uniprotID,
                //We need this dataType to set the Accept header correctly
                dataType: "json"
            }).done(function(d) {
                d.variants.features = DataLoader.processVariants(d);
                return DataLoader.processData(d);
            }).fail(function(e){
                return(e);
            });
        }, processData: function(d){
            var consecutive = 0;
            _.each(d, function(datum) {
                if (datum && datum.features) {
                    _.each(datum.features, function(feature) {
                        if (feature.variants) {
                            _.each(feature.variants, function(variant) {
                                variant.internalId = "ft_" + consecutive;
                                variant.type.label = variant.type.label.replace('_', ' ');
                                consecutive++;
                            });
                        } else {
                            feature.internalId = "ft_" + consecutive;
                            feature.type.label = feature.type.label.replace('_', ' ');
                            consecutive++;
                        }
                    });
{'fraction_non_alphanumeric': 0.12179487179487179, 'fraction_numerical': 0.0005827505827505828, 'mean_word_length': 1.2034659820282414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6371188', 'n_tokens_mistral': 876, 'n_tokens_neox': 835, 'n_words': 169}