<commit_before>#!/usr/bin/env node

var net = require('net')
  , repl = require('repl')
  , underscore = require('underscore')
  , colors = require('colors')
  , appium  = require('../server')
  , parser = require('./parser');
  ;

var startRepl = function() {
  var help = function() {
    console.log("\nWelcome to the Appium CLI".cyan);
    console.log(" - Access the appium object via the object: 'appium'".grey);
    console.log(" - appium.run is the function to start the server".grey);
    console.log(" - args is the default params data structure".grey);
    console.log(" - set args.app then run appium.run(args);\n".grey);
    return 'Thanks for asking';
  };
  help()
  var r = repl.start('(appium): ');
  r.context.appium = appium;
  r.context.parser = parser();
  r.context.help = help;
  r.context.args = {
    app: '/path/to/test/app'
    , verbose: '1'
    , udid: null
    , address: '127.0.0.1'
    , port: 4723
    , remove: true
  }

  var server = net.createServer(function (socket) {
    connections += 1;
    socket.setTimeout(5*60*1000, function() {
      socket.destroy();
    });
    repl.start("(appium): ", socket);
  }).listen(process.platform === "win32" ?
      "\\\\.\\pipe\\node-repl-sock-"
       + process.pid : "/tmp/node-repl-sock-"
       + process.pid);

  r.on('exit', function () {
    server.close();
    process.exit();
  });
};

if (process.argv[2] === "shell") {
  startRepl();
}
else {
  var args = parser().parseArgs();
  args.verbose = 1;
  console.log("Pre-flight check ...".grey);
  appium.run(args, function() { console.log('Rock and roll.'.grey) });
}<commit_msg>LINTING MY BIN CI!<commit_after>#!/usr/bin/env node
"use strict";

var net = require('net')
  , repl = require('repl')
  , underscore = require('underscore')
  , colors = require('colors')
  , appium  = require('../server')
  , parser = require('./parser')
  ;

var startRepl = function() {
  var help = function() {
    console.log("\nWelcome to the Appium CLI".cyan);
    console.log(" - Access the appium object via the object: 'appium'".grey);
    console.log(" - appium.run is the function to start the server".grey);
    console.log(" - args is the default params data structure".grey);
    console.log(" - set args.app then run appium.run(args);\n".grey);
    return 'Thanks for asking';
  };

  help();

  var r = repl.start('(appium): ');
  r.context.appium = appium;
  r.context.parser = parser();
  r.context.help = help;
  r.context.args = {
    app: '/path/to/test/app'
    , verbose: '1'
    , udid: null
    , address: '127.0.0.1'
    , port: 4723
    , remove: true
  };

  var connections = 0;
  var server = net.createServer(function (socket) {
    connections += 1;
    socket.setTimeout(5*60*1000, function() {
      socket.destroy();
    });
    repl.start("(appium): ", socket);
  }).listen(process.platform === "win32" ? "\\\\.\\pipe\\node-repl-sock-" + process.pid : "/tmp/node-repl-sock-" + process.pid);

  r.on('exit', function () {
    server.close();
    process.exit();
  });
};

if (process.argv[2] === "shell") {
  startRepl();
}
else {
  var args = parser().parseArgs();
  args.verbose = 1;
  console.log("Pre-flight check ...".grey);
  appium.run(args, function() { console.log('Rock and roll.'.grey); });
}
{'fraction_non_alphanumeric': 0.19656019656019655, 'fraction_numerical': 0.014434889434889435, 'mean_word_length': 2.933574879227053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3971552', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1118, 'n_words': 256}