<commit_before>export function getRestaurantsApi () {
  const url = '//kcit-bzzqfx1:40001/api/business/a/47.0845/-122.5284/47.7803/-121.0657';
  return new Promise(function (resolve, reject) {
    fetch(url)
      .then(response => {
        if(response.ok) {
          return resolve(response.json());
        }
        return Promise.reject(Error(response.status));
      })
      .catch((err) => {
        return reject(Error('Network Error: ' + err));
      });

  //   // Do the usual XHR stuff
  //   let req = new XMLHttpRequest();
  //   req.open('GET', url);

  //   req.onload = function () {
  //     // This is called even on 404 etc
  //     // so check the status
  //     if (req.status == 200) {
  //       // Resolve the promise with the response text
  //       resolve(req.response);
  //     }else {
  //       // Otherwise reject with the status text
  //       // which will hopefully be a meaningful error
  //       reject(Error(req.statusText));
  //     }
  //   };

  //   // Handle network errors
  //   req.onerror = function () {
  //     reject(Error('Network Error'));
  //   };

  //   // Make the request
  //   req.send();
 });
}

export function getBusinessApi (id) {<commit_msg>Testing polyfills for promise, fetch<commit_after>export function getRestaurantsApi () {
  const url = '//kcit-bzzqfx1:40001/api/business/a/47.0845/-122.5284/47.7803/-121.0657';
  return new Promise(function (resolve, reject) {
    // fetch(url)
    //   .then(response => {
    //     if(response.ok) {
    //       return resolve(response.json());
    //     }
    //     return Promise.reject(Error(response.status));
    //   })
    //   .catch((err) => {
    //     return reject(Error('Network Error: ' + err));
    //   });

    // Do the usual XHR stuff
    let req = new XMLHttpRequest();
    req.open('GET', url);

    req.onload = function () {
      // This is called even on 404 etc
      // so check the status
      if (req.status == 200) {
        // Resolve the promise with the response text
        resolve(JSON.parse(req.response));
      }else {
        // Otherwise reject with the status text
        // which will hopefully be a meaningful error
        reject(Error(req.statusText));
      }
    };

    // Handle network errors
    req.onerror = function () {
      reject(Error('Network Error'));
    };

    // Make the request
    req.send();
 });
}

export function getBusinessApi (id) {
{'fraction_non_alphanumeric': 0.15542763157894737, 'fraction_numerical': 0.03125, 'mean_word_length': 1.9277978339350181, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7436529', 'n_tokens_mistral': 801, 'n_tokens_neox': 739, 'n_words': 180}