<commit_before>/* eslint-disable no-console */
import client from '_client';
import { join } from 'path';
import openDatabase from '_server/utils/openCordovaWebSqlEvcoreFullPath';
import DB from '_server/utils/webSqlP';

import dataServers from '_server';

import { addRoute } from './restAPI';


require('isomorphic-fetch');

global.Promise = require('bluebird');

Promise.config({
  longStackTraces: true,
  warnings: true, // note, run node with --trace-warnings to see full stack traces for warnings
});

const resolveLocalFileSystemURL = path => new Promise((resolve, reject) =>
  window.resolveLocalFileSystemURL(
    path,
    resolve,
    (err) => {
      reject(`resolveLocalFileSystemURL for ${path} returned ${err.message || err}`);
    }
  )
);
function readFile(path, encoding) {
  return resolveLocalFileSystemURL(path)
  .then(fileEntry => new Promise((resolve, reject) => {
    fileEntry.file(
      (file) => {
        const reader = new FileReader();

        reader.onloadend = () => {
          resolve(reader.result);
        };
        reader.onerror = (ev) => {
          reject(`readAsText for ${path} returned ${ev.message || ev}`);
        };
        reader.readAsText(file, encoding);
      },<commit_msg>Use Bluebird only for development<commit_after>/* eslint-disable no-console */
import client from '_client';
import { join } from 'path';
import openDatabase from '_server/utils/openCordovaWebSqlEvcoreFullPath';
import DB from '_server/utils/webSqlP';

import dataServers from '_server';

import { addRoute } from './restAPI';


require('isomorphic-fetch');

if (process.env.NODE_ENV !== 'production') {
  /* eslint-disable import/no-extraneous-dependencies, global-require */
  global.Promise = require('bluebird');
  /* eslint-enable import/no-extraneous-dependencies, global-require */

  Promise.config({
    longStackTraces: true,
    warnings: true, // note, run node with --trace-warnings to see full stack traces for warnings
  });
}

const resolveLocalFileSystemURL = path => new Promise((resolve, reject) =>
  window.resolveLocalFileSystemURL(
    path,
    resolve,
    (err) => {
      reject(`resolveLocalFileSystemURL for ${path} returned ${err.message || err}`);
    }
  )
);
function readFile(path, encoding) {
  return resolveLocalFileSystemURL(path)
  .then(fileEntry => new Promise((resolve, reject) => {
    fileEntry.file(
      (file) => {
        const reader = new FileReader();

        reader.onloadend = () => {
          resolve(reader.result);
        };
        reader.onerror = (ev) => {
          reject(`readAsText for ${path} returned ${ev.message || ev}`);
        };
        reader.readAsText(file, encoding);
      },
{'fraction_non_alphanumeric': 0.14035740878629932, 'fraction_numerical': 0.0, 'mean_word_length': 3.4413223140495868, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '6463022', 'n_tokens_mistral': 786, 'n_tokens_neox': 786, 'n_words': 193}