<commit_before>/*eslint no-console: ["error", { allow: ["log"] }] */
/*eslint no-unused-vars: ["error", { "args": "none" }]*/

const request = require('request');
const path = require('path');
const Promise = require('bluebird');
const fs = require('fs');

const elasticsearch = require('../src/server/plugins/gp-lookup/elasticsearch');

const GPMedicalPracticesSourceURL = process.env.GPMedicalPracticesSourceURL;

const GPMedicalPractitionersSourceURL = process.env.GPMedicalPractitionersSourceURL;

const appRootPath = path.dirname(__dirname);
const practiceDataPath = path.join(appRootPath, 'data/practiceData.json');

const requestAsync = Promise.promisify(request);

Promise.all([requestAsync(GPMedicalPracticesSourceURL), requestAsync(GPMedicalPractitionersSourceURL)])
    .then(function(allData) {
      console.log('Getting practices data from sources');
      const practicesData = JSON.parse(allData[0].body);
      const practitionersData = JSON.parse(allData[1].body);
      transformPracticeData(practicesData, practitionersData);
    });


function transformPracticeData(practicesData, practitionersData) {
  let practiceList = [];
  for(let i = 0; i < practicesData.length; i++){<commit_msg>updageGPindex command fixes<commit_after>/*eslint no-console: ["error", { allow: ["log"] }] */
/*eslint no-unused-vars: ["error", { "args": "none" }]*/

const request = require('request');
const path = require('path');
const Promise = require('bluebird');
const fs = require('fs');

const elasticsearch = require('../src/server/plugins/gp-lookup/elasticsearch');

const GPMedicalPracticesSourceURL = process.env.GPMEDICALPRACTICESSOURCEURL;

const GPMedicalPractitionersSourceURL = process.env.GPMEDICALPRACTITIONERSSOURCEURL;

const appRootPath = path.dirname(__dirname);
const practiceDataPath = path.join(appRootPath, 'data/practiceData.json');

const requestAsync = Promise.promisify(request);

Promise.all([requestAsync(GPMedicalPracticesSourceURL), requestAsync(GPMedicalPractitionersSourceURL)])
    .then(function(allData) {
      console.log('Getting practices data from sources');
      const practicesData = JSON.parse(allData[0].body);
      const practitionersData = JSON.parse(allData[1].body);
      transformPracticeData(practicesData, practitionersData);
    });


function transformPracticeData(practicesData, practitionersData) {
  let practiceList = [];
  for(let i = 0; i < practicesData.length; i++){
{'fraction_non_alphanumeric': 0.1382716049382716, 'fraction_numerical': 0.0024691358024691358, 'mean_word_length': 6.171091445427729, 'pattern_counts': {'":': 2, '<': 5, '<?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': '3851487', 'n_tokens_mistral': 752, 'n_tokens_neox': 734, 'n_words': 137}