<commit_before>var keybase_user = function() {
  if (typeof require == 'function') {
    var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
    var exports = module.exports = {};	
    var httpGet = function(url)
    {
      var xmlHttp = new XMLHttpRequest();
      xmlHttp.open("GET", url, false);
      xmlHttp.send(null);
      return JSON.parse(xmlHttp.responseText);
    }	
  } else {
    var exports = {};
    var httpGet = $.get;
  }

  var url = 'https://keybase.io/_/api/1.0/user/lookup.json?';
  function checkSrc(src) {
    if (src === undefined) {
      src = 'username';
      return src;
    } else {
      return src;
    }
  }

  exports.full = function(val, src) {
    src = checkSrc(src);
    var res = httpGet(url + src + '=' + val);
    if (src == 'username') {
      return res.them;
    } else {
      return res.them[0];
    }
  }

  exports.basics = function(val, src) {
    src = checkSrc(src);
    var res = httpGet(url + src + '=' + val + '&fields=basics');
    if (src == 'username') {
      return res.them.basics;
    } else {
      return res.them[0].basics;
    }
  }

  exports.profile = function(val, src) {
    src = checkSrc(src);
    var res = httpGet(url + src + '=' + val + '&fields=profile');
    if (src == 'username') {
      return res.them.profile;
    } else {
      return res.them[0].profile;
    }
  }

  exports.public_keys = function(val, src) {
    src = checkSrc(src);
    var res = httpGet(url + src + '=' + val + '&fields=public_keys');
    if (src == 'username') {
      return res.them.public_keys;
    } else {
      return res.them[0].public_keys;
    }
  }

  exports.crypto_add = function(val, src) {
    src = checkSrc(src);
    var res = httpGet(url + src + '=' + val  + '&fields=cryptocurrency_addresses');
    if (src == 'username') {
      return res.them.cryptocurrency_addresses;
    } else {
      return res.them[0].cryptocurrency_addresses;
    }
  }
  return exports
}();<commit_msg>callback functions change<commit_after>var keybase_user = function() {
  if (typeof require == 'function') {
    var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
    var exports = module.exports = {};	
    var httpGet = function(url)
    {
      var xmlHttp = new XMLHttpRequest();
      xmlHttp.open("GET", url, false);
      xmlHttp.send(null);
      return JSON.parse(xmlHttp.responseText);
    }	
  } else {
    var exports = {};
    var httpGet = $.get;
  }

  var url = 'https://keybase.io/_/api/1.0/user/lookup.json?';
   exports.info = function(options, cb) {
     var val = options.value;
     var src = options.source || 'username';

     var req = {
       id: httpGet(url + src + '=' + val),
       basics: httpGet(url + src + '=' + val + '&fields=basics'),
       profile: httpGet(url + src + '=' + val + '&fields=profile'),
       public_keys: httpGet(url + src + '=' + val + '&fields=public_keys'),
       crypto_add: httpGet(url + src + '=' + val + '&fields=cryptocurrency_addresses')
     }
     
     var res = {
       id: req.id.them.id || req.id.them[0].id,
       basics: req.basics.them.basics || req.basics.them[0].basics,
       profile: req.profile.them.profile || req.profile.them[0].profile,
       public_keys: req.public_keys.them.public_keys || req.public_keys.them[0].public_keys,
       crypto_add: req.crypto_add.them.cryptocurrency_addresses || req.crypto_add.them[0].cryptocurrency_addresses
     }
     cb(res);
   }
  return exports
}();
{'fraction_non_alphanumeric': 0.16034732272069466, 'fraction_numerical': 0.004052098408104197, 'mean_word_length': 2.6150627615062763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '1473446', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1170, 'n_words': 236}