<commit_before>"use strict";
var parser = require('./parser.js')()
  , logFactory = require('./logger.js')
  , logger = null
  , args = null
  , path = require('path');

process.chdir(path.resolve(__dirname, '../..'));

if (require.main === module) {
  args = parser.parseArgs();
  logFactory.init(args);
}

logger = logFactory.get('appium');

var http = require('http')
  , express = require('express')
  , path = require('path')
  , fs = require('fs')
  , appium = require('../appium.js')
  , parserWrap = require('./middleware').parserWrap
  , appiumVer = require('../../package.json').version
  , appiumRev = null
  , async = require('async')
  , helpers = require('./helpers.js')
  , logFinalWarning = require('../helpers.js').logFinalDeprecationWarning
  , getConfig = require('../helpers.js').getAppiumConfig
  , allowCrossDomain = helpers.allowCrossDomain
  , catchAllHandler = helpers.catchAllHandler
  , checkArgs = helpers.checkArgs
  , winstonStream = helpers.winstonStream
  , configureServer = helpers.configureServer
  , startListening = helpers.startListening<commit_msg>make sure appium won't run under sudo. Too many people run into problems with that<commit_after>"use strict";
var parser = require('./parser.js')()
  , logFactory = require('./logger.js')
  , logger = null
  , args = null
  , path = require('path');

process.chdir(path.resolve(__dirname, '../..'));

if (require.main === module) {
  args = parser.parseArgs();
  logFactory.init(args);
}

logger = logFactory.get('appium');

if (typeof process.env.SUDO_UID !== "undefined") {
  logger.error("Appium will not function correctly if used under sudo. " +
               "Please rerun as a non-root user. If you had to install " +
               "Appium using `sudo npm install -g appium`, the solution " +
               "is to reinstall Node using a method (Homebrew, for example) " +
               "that doesn't require sudo to install global npm packages.");
  process.exit(1);
}

var http = require('http')
  , express = require('express')
  , path = require('path')
  , fs = require('fs')
  , appium = require('../appium.js')
  , parserWrap = require('./middleware').parserWrap
  , appiumVer = require('../../package.json').version
  , appiumRev = null
  , async = require('async')
  , helpers = require('./helpers.js')
  , logFinalWarning = require('../helpers.js').logFinalDeprecationWarning
  , getConfig = require('../helpers.js').getAppiumConfig
  , allowCrossDomain = helpers.allowCrossDomain
  , catchAllHandler = helpers.catchAllHandler
  , checkArgs = helpers.checkArgs
  , winstonStream = helpers.winstonStream
  , configureServer = helpers.configureServer
  , startListening = helpers.startListening
{'fraction_non_alphanumeric': 0.15672471285661357, 'fraction_numerical': 0.0003705075954057058, 'mean_word_length': 3.7202797202797204, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3173159', 'n_tokens_mistral': 813, 'n_tokens_neox': 807, 'n_words': 184}