<commit_before>var util = require('util');
var http = require('http');

var baseUrl;

function createWofPipResolver(url) {
  baseUrl = url;

  return function(centroid, callback) {
    var url = util.format('%s/?latitude=%d&longitude=%d', baseUrl, centroid.lat, centroid.lon);

    http.get(url, function(response) {
      var contents = '';

      var result = {};

      response.setEncoding('utf8');
      response.on('data', function(data) { contents += data; } );
      response.on('end', function() {
        JSON.parse(contents).forEach(function(row) {
          switch (row.Placetype) {
            case 'country':
              result.country = row.Name;
              break;
            case 'region':<commit_msg>moved baseUrl to a more appropriate scope<commit_after>var util = require('util');
var http = require('http');

function createWofPipResolver(url) {
  var baseUrl = url;

  return function(centroid, callback) {
    var url = util.format('%s/?latitude=%d&longitude=%d', baseUrl, centroid.lat, centroid.lon);

    http.get(url, function(response) {
      var contents = '';

      var result = {};

      response.setEncoding('utf8');
      response.on('data', function(data) { contents += data; } );
      response.on('end', function() {
        JSON.parse(contents).forEach(function(row) {
          switch (row.Placetype) {
            case 'country':
              result.country = row.Name;
              break;
            case 'region':
{'fraction_non_alphanumeric': 0.14959016393442623, 'fraction_numerical': 0.001366120218579235, 'mean_word_length': 2.7468030690537084, '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': '2937810', 'n_tokens_mistral': 440, 'n_tokens_neox': 427, 'n_words': 92}