<commit_before>var request = require('request')
  ;

module.exports.query = function(req,res) {

  var badCharsAddr = /[^A-Za-z0-9\.\-\#\s]/g;
  var addr = req.param('address') || '';
  addr = addr.replace(badCharsAddr,'');
  var city = 'Chicago';
  var state = 'IL';
  var zip = req.param('zip') || '';
  zip = zip.replace(/[^0-9\-\s]/g,'');
  var location = [addr,city,state,zip].join(',');

  var url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + location;
  request.get(url, function(err, resp, body){
    if (err) {
      console.error(err);
      return res.sendStatus(500);
    }

    if (resp.statusCode !== 200) {
      console.error("GOOGLE API FAILURE: " + resp.statusCode);
      return res.send(resp.statusCode);
    }

    var body = JSON.parse(body);
    if (body.results[0].formatted_address === "Chicago, IL, USA") {
      res.sendStatus(404);
    } else {
      res.json(body.results);<commit_msg>Fix deprecation warnings<commit_after>var request = require('request')
  ;

module.exports.query = function(req,res) {

  var badCharsAddr = /[^A-Za-z0-9\.\-\#\s]/g;
  var addr = req.query.address || '';
  addr = addr.replace(badCharsAddr,'');
  var city = 'Chicago';
  var state = 'IL';
  var zip = req.query.zip || '';
  zip = zip.replace(/[^0-9\-\s]/g,'');
  var location = [addr,city,state,zip].join(',');

  var url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + location;
  request.get(url, function(err, resp, body){
    if (err) {
      console.error(err);
      return res.sendStatus(500);
    }

    if (resp.statusCode !== 200) {
      console.error("GOOGLE API FAILURE: " + resp.statusCode);
      return res.send(resp.statusCode);
    }

    var body = JSON.parse(body);
    if (body.results[0].formatted_address === "Chicago, IL, USA") {
      res.sendStatus(404);
    } else {
      res.json(body.results);
{'fraction_non_alphanumeric': 0.198611852642819, 'fraction_numerical': 0.014949279231179925, 'mean_word_length': 3.1006564551422318, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3466747', 'n_tokens_mistral': 701, 'n_tokens_neox': 657, 'n_words': 121}