<commit_before>var ShapeShift = (function() {
    var JP = JSON.parse;
    var JS = JSON.stringify;

    function CreateXmlHttp(){
        var xmlhttp;
        if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        }
        else {// code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlhttp;
    }

    function AjaxRequest(xmlhttp, apiEp, data, cb) {
        if(cb === undefined){
            cb = data;
        }

        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    var parsedResponse = JP(xmlhttp.responseText);
                    cb.apply(null, [parsedResponse]);
                } else {
                    cb.apply(null, [new Error('Request Failed')])
                }
            }
        };

        var url='https://shapeshift.io/'+apiEp.path;
        var type = apiEp.method;

        xmlhttp.open(apiEp.method, url, true);
        if(type.toUpperCase() === 'POST') {
            xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
            xmlhttp.send(JS(data));
        } else if(type.toUpperCase() === 'GET') {
            xmlhttp.send();
        }
    }

    var endPoints = {
        Rate : { path : 'rate', method : 'GET' }
        , DepositLimit : { path : 'limit', method : 'GET' }
        , MarketInfo : { path : 'marketinfo', method : 'GET' }
        , RecentTxList : { path : 'recenttx', method : 'GET' }
        , StatusOfDepositToAddress : { path : 'txStat', method : 'GET' }
        , TimeRemainingFixedAmountTx : { path : 'timeremaining', method : 'GET' }<commit_msg>Return error from Shapeshift when pairs are unavailable.<commit_after>var ShapeShift = (function() {
    var JP = JSON.parse;
    var JS = JSON.stringify;

    function CreateXmlHttp(){
        var xmlhttp;
        if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        }
        else {// code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlhttp;
    }

    function AjaxRequest(xmlhttp, apiEp, data, cb) {
        if(cb === undefined){
            cb = data;
        }

        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    var parsedResponse = JP(xmlhttp.responseText);
                    cb.apply(null, [parsedResponse]);
                } else if (xmlhttp.status === 500) {
                    var parsedResponse = JP(xmlhttp.responseText);
                    if (typeof parsedResponse.error === 'string') {
                        cb.apply(null, [parsedResponse]);
                    } else {
                        cb.apply(null, [new Error('Request Failed')]);
                    }
                } else {
                    cb.apply(null, [new Error('Request Failed')])
                }
            }
        };

        var url='https://shapeshift.io/'+apiEp.path;
        var type = apiEp.method;

        xmlhttp.open(apiEp.method, url, true);
        if(type.toUpperCase() === 'POST') {
            xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
            xmlhttp.send(JS(data));
        } else if(type.toUpperCase() === 'GET') {
            xmlhttp.send();
        }
    }

    var endPoints = {
        Rate : { path : 'rate', method : 'GET' }
        , DepositLimit : { path : 'limit', method : 'GET' }
        , MarketInfo : { path : 'marketinfo', method : 'GET' }
        , RecentTxList : { path : 'recenttx', method : 'GET' }
        , StatusOfDepositToAddress : { path : 'txStat', method : 'GET' }
        , TimeRemainingFixedAmountTx : { path : 'timeremaining', method : 'GET' }
{'fraction_non_alphanumeric': 0.13584329687102517, 'fraction_numerical': 0.004833375731366065, 'mean_word_length': 1.7362560890744607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 28}, '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': '5615170', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1098, 'n_words': 247}