<commit_before>'use strict';
const request = require('request');
const fs = require('fs');

function Generator() {
}

Generator.prototype.wikipedia = function (o) {

  return new Promise(function(resolve, reject) {

    const memeReq = request({
      method: 'get',
      uri: 'http://speaklolcat.com/?from=' + encodeURIComponent(o.data.featured)
    }, function (err, response, body) {
      let matches;

      if (!err && response.statusCode === 200) {

        matches = body.match(/<textarea.*?id="to".*?>(.*?)<\/textarea>/i);

        if (matches) {
          o.meme = matches[1];
        }

        const req = request({
          method: 'get',
          uri: o.host + o.data.potd
        }, function(err, response, body) {
          let matches;

          if (!err && response.statusCode === 200) {
            if (matches = body.match(/<div class="fullMedia">.*?<a href="(.*?)".*?>/)) {
              let parts = matches[1].split('.'),
                ext = parts[parts.length - 1],
                imageUri = /^https?:\/\//.test(matches[1]) ? matches[1] : 'https:' + matches[1],
                filePath = ['', '/public/images/' + o.date, ext].join('.'),
                fileUri = filePath.replace("/public", "");

              fs.exists(filePath, function(exists) {
                o.file = fileUri;

                if (exists) {
                  resolve(o);
                }else{
                  const imgReq = request({
                    method: 'get',
                    uri: imageUri
                  }).on('error', function (err) {
                    reject(err);<commit_msg>fix(Generator): Change download path<commit_after>'use strict';
const request = require('request');
const fs = require('fs');

function Generator() {
}

Generator.prototype.wikipedia = function (o) {

  return new Promise(function(resolve, reject) {

    const memeReq = request({
      method: 'get',
      uri: 'http://speaklolcat.com/?from=' + encodeURIComponent(o.data.featured)
    }, function (err, response, body) {
      let matches;

      if (!err && response.statusCode === 200) {

        matches = body.match(/<textarea.*?id="to".*?>(.*?)<\/textarea>/i);

        if (matches) {
          o.meme = matches[1];
        }

        const req = request({
          method: 'get',
          uri: o.host + o.data.potd
        }, function(err, response, body) {
          let matches;

          if (!err && response.statusCode === 200) {
            if (matches = body.match(/<div class="fullMedia">.*?<a href="(.*?)".*?>/)) {
              let parts = matches[1].split('.'),
                ext = parts[parts.length - 1],
                imageUri = /^https?:\/\//.test(matches[1]) ? matches[1] : 'https:' + matches[1],
                filePath = ['', '/public/images/memes/' + o.date, ext].join('.'),
                fileUri = filePath.replace("/public", "");

              fs.exists(filePath, function(exists) {
                o.file = fileUri;

                if (exists) {
                  resolve(o);
                }else{
                  const imgReq = request({
                    method: 'get',
                    uri: imageUri
                  }).on('error', function (err) {
                    reject(err);
{'fraction_non_alphanumeric': 0.17474529175671505, 'fraction_numerical': 0.007409694350108058, 'mean_word_length': 1.720403022670025, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4845420', 'n_tokens_mistral': 976, 'n_tokens_neox': 917, 'n_words': 200}