<commit_before>'use strict';

const spawn = require('child_process').spawn;
const program = require('commander');
let appOpts;

/* eslint-disable no-console */
function parse() {
  if (process.defaultApp) {
    const opts = program
    .option('-dev, --development', 'run in development mode (NODE_ENV === "development")')
    .option('-w, --webpack', 'boot webpack dev server as child process')
    .option('--hotswap', 'enable hotswapping of node modules for main process')
    .option('--log-level [level]', 'set log level (silly/verbose/info/warn/error)')
    .parse(process.argv);
    appOpts = opts;

    if (opts.development) {
      process.env.NODE_ENV = 'development';
      console.log('NODE_ENV set to "development"');
    }

    if (opts.webpack) {
      console.log('booting webpack-dev-server');
      const wpds = spawn('node', ['webpack-dev-server.js', '--development']);
      wpds.stdout.on('data', data => {
        data = data.toString();
        // don't fill the screen with useful build information. scan for it,
        // summarize it instead
        const builtRegex = /.*(\[(built|not cacheable)\]|\{0\}).*[\r\n]/gm;
        const builtFiles = data.match(builtRegex);
        data = data.replace(builtRegex, '');
        console.log([
          'coinstac-wpds:',
          builtFiles ? `(${builtFiles.length} files processed` : '',
          data,
        ].join(' '));
      });

      wpds.stderr.on('data', data => {
        console.error(`coinstac-webpack-server [error]: ${data}`);
      });

      wpds.on('close', code => {
        if (code !== 0) {
          console.log(`coinstac-webpack-server [fatal] ${code}`);
        }
      });

      process.on('exit', wpds.kill);
    }
  }
}
/* eslint-enable no-console */

parse.get = function get() {
  return appOpts || {};
};

module.exports = parse;
<commit_msg>fix(ui): lint oneliner<commit_after>'use strict';

const spawn = require('child_process').spawn;
const program = require('commander');
let appOpts;

/* eslint-disable no-console */
function parse() {
  if (process.defaultApp) {
    const opts = program
    .option('-dev, --development', 'run in development mode (NODE_ENV === "development")')
    .option('-w, --webpack', 'boot webpack dev server as child process')
    .option('--hotswap', 'enable hotswapping of node modules for main process')
    .option('--log-level [level]', 'set log level (silly/verbose/info/warn/error)')
    .parse(process.argv);
    appOpts = opts;

    if (opts.development) {
      process.env.NODE_ENV = 'development';
      console.log('NODE_ENV set to "development"');
    }

    if (opts.webpack) {
      console.log('booting webpack-dev-server');
      const wpds = spawn('node', ['webpack-dev-server.js', '--development']);
      wpds.stdout.on('data', data => {
        data = data.toString();
        // don't fill the screen with useful build information. scan for it,
        // summarize it instead
        const builtRegex = /.*(\[(built|not cacheable)\]|\{0\}).*[\r\n]/gm; // eslint-disable-line
        const builtFiles = data.match(builtRegex);
        data = data.replace(builtRegex, '');
        console.log([
          'coinstac-wpds:',
          builtFiles ? `(${builtFiles.length} files processed` : '',
          data,
        ].join(' '));
      });

      wpds.stderr.on('data', data => {
        console.error(`coinstac-webpack-server [error]: ${data}`);
      });

      wpds.on('close', code => {
        if (code !== 0) {
          console.log(`coinstac-webpack-server [fatal] ${code}`);
        }
      });

      process.on('exit', wpds.kill);
    }
  }
}
/* eslint-enable no-console */

parse.get = function get() {
  return appOpts || {};
};

module.exports = parse;

{'fraction_non_alphanumeric': 0.1801825993555317, 'fraction_numerical': 0.0010741138560687433, 'mean_word_length': 2.606001936108422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6958642', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1155, 'n_words': 263}