SCP manager.
@param options The options to use when sending the command to the remote server.
@constructor
436628
function SCP(options) {
	this.options = options || {};

	console.assert(this.options.hostname, "Hostname required!");

	this.debug = !!options.debug;
	this.listener = new Listener({
		debug: options.debug
	});
}
631694
function NjsCompiler(options) {
    this.nodeSequence = 0;
    this.options = options || {};
    if (!this.options.runtime) {
        this.options.runtime = 'njs';
    }
    this.parseBooleanOptions("exceptions", true);
}
179061
function HttpServer(options) {
  options = options || {};

  if (options.root) {
    this.root = options.root;
  }
  else {
    try {
      fs.lstatSync('./public');
      this.root = './public';
    }
    catch (err) {
      this.root = './';
    }
  }

  this.headers = options.headers || {};

  this.cache = options.cache === undefined ? 3600 : options.cache; // in seconds.
  this.showDir = options.showDir !== 'false';
  this.autoIndex = options.autoIndex !== 'false';
  this.gzip = options.gzip === true;
  this.contentType = options.contentType || 'application/octet-stream';

  if (options.ext) {
    this.ext = options.ext === true
      ? 'html'
      : options.ext;
  }

  var before = options.before ? options.before.slice() : [];

  before.push(function (req, res) {
    if (options.logFn) {
      options.logFn(req, res);
    }

    res.emit('next');
  });

  if (options.cors) {
    this.headers['Access-Control-Allow-Origin'] = '*';
    this.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Range';
    if (options.corsHeaders) {
      options.corsHeaders.split(/\s*,\s*/)
          .forEach(function (h) { this.headers['Access-Control-Allow-Headers'] += ', ' + h; }, this);
    }
    before.push(corser.create(options.corsHeaders ? {
      requestHeaders: this.headers['Access-Control-Allow-Headers'].split(/\s*,\s*/)
    } : null));
  }

  if (options.robots) {
    before.push(function (req, res) {
      if (req.url === '/robots.txt') {
        res.setHeader('Content-Type', 'text/plain');
        var robots = options.robots === true
          ? 'User-agent: *\nDisallow: /'
          : options.robots.replace(/\\n/, '\n');

        return res.end(robots);
      }

      res.emit('next');
    });
  }

  before.push(ecstatic({
    root: this.root,
    cache: this.cache,
    showDir: this.showDir,
    autoIndex: this.autoIndex,
    defaultExt: this.ext,
    gzip: this.gzip,
    contentType: this.contentType,
//    handleError: typeof options.proxy !== 'string'
    handleError: (!options.fallback || typeof options.proxy === 'string')
  }));

  if (typeof options.proxy === 'string') {
    var proxy = httpProxy.createProxyServer({});
    before.push(function (req, res) {
      proxy.web(req, res, {
        target: options.proxy,
        changeOrigin: true
      });
    });
  }

  if (options.fallback) {
    before.push(function (req, res) {
      if (res.statusCode === 404) {
        res.redirect(options.fallback.address, 301);
      }
    });
  }

  var serverOptions = {
    before: before,
    headers: this.headers,
    onError: function (err, req, res) {
      if (options.logFn) {
        options.logFn(req, res, err);
      }

      res.end();
    }
  };

  if (options.https) {
    serverOptions.https = options.https;
  }

  this.server = union.createServer(serverOptions);
}
1104829
private String manageSet(String[] options) throws Exception {
        // sccp set <command> <value> stackname <stack-name>
        if (options.length < 4) {
            return TCAPOAMMessage.INVALID_COMMAND;
        }

        int count = 4;

        while (count < options.length) {
            String key = options[count++];
            if (key == null) {
                return TCAPOAMMessage.INVALID_COMMAND;
            }

            if (key.equals("stackname")) {
                String m3uaStackName = options[count++];

                TCAPStackImpl sccpStaclImpl = this.tcapStacks.get(m3uaStackName);

                if (sccpStaclImpl == null) {
                    return String.format(TCAPOAMMessage.NO_TCAP_STCAK_CONFIGURE, m3uaStackName);
                }

                this.tcapStack = sccpStaclImpl;
            } else {
                return TCAPOAMMessage.INVALID_COMMAND;
            }

        }

        this.setDefaultValue();

        String parName = options[2].toLowerCase();

        if (parName.equals("dialogidletimeout")) {
            long val = Long.parseLong(options[3]);
            this.tcapStack.setDialogIdleTimeout(val);
        } else if (parName.equals("invoketimeout")) {
            long val = Long.parseLong(options[3]);
            this.tcapStack.setInvokeTimeout(val);
        } else if (parName.equals("maxdialogs")) {
            int val = Integer.parseInt(options[3]);
            this.tcapStack.setMaxDialogs(val);
        } else if (parName.equals("dialogidrangestart")) {
            long val = Long.parseLong(options[3]);
            this.tcapStack.setDialogIdRangeStart(val);
        } else if (parName.equals("dialogidrangeend")) {
            long val = Long.parseLong(options[3]);
            this.tcapStack.setDialogIdRangeEnd(val);
//        } else if (parName.equals("previewmode")) {
//            boolean val = Boolean.parseBoolean(options[3]);
//            this.tcapStack.setPreviewMode(val);
        } else if (parName.equals("donotsendprotocolversion")) {
            boolean val = Boolean.parseBoolean(options[3]);
            this.tcapStack.setDoNotSendProtocolVersion(val);
        } else if (parName.equals("statisticsenabled")) {
            boolean val = Boolean.parseBoolean(options[3]);
            this.tcapStack.setStatisticsEnabled(val);
        } else if (parName.equals("swaptcapidbytes")) {
            boolean val = Boolean.parseBoolean(options[3]);
            this.tcapStack.setSwapTcapIdBytes(val);

        } else if (parName.equals("executordelaythreshold_1")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_ExecutorDelayThreshold_1(val);
        } else if (parName.equals("executordelaythreshold_2")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_ExecutorDelayThreshold_2(val);
        } else if (parName.equals("executordelaythreshold_3")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_ExecutorDelayThreshold_3(val);

        } else if (parName.equals("executorbacktonormaldelaythreshold_1")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_ExecutorBackToNormalDelayThreshold_1(val);
        } else if (parName.equals("executorbacktonormaldelaythreshold_2")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_ExecutorBackToNormalDelayThreshold_2(val);
        } else if (parName.equals("executorbacktonormaldelaythreshold_3")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_ExecutorBackToNormalDelayThreshold_3(val);

        } else if (parName.equals("memorythreshold_1")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_MemoryThreshold_1(val);
        } else if (parName.equals("memorythreshold_2")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_MemoryThreshold_2(val);
        } else if (parName.equals("memorythreshold_3")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_MemoryThreshold_3(val);

        } else if (parName.equals("backtonormalmemorythreshold_1")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_BackToNormalMemoryThreshold_1(val);
        } else if (parName.equals("backtonormalmemorythreshold_2")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_BackToNormalMemoryThreshold_2(val);
        } else if (parName.equals("backtonormalmemorythreshold_3")) {
            double val = Double.parseDouble(options[3]);
            this.tcapStack.setCongControl_BackToNormalMemoryThreshold_3(val);

        } else if (parName.equals("blockingincomingtcapmessages")) {
            boolean val = Boolean.parseBoolean(options[3]);
            this.tcapStack.setCongControl_blockingIncomingTcapMessages(val);

        } else if (parName.equals("slsrange")) {
            String val = String.valueOf( options[3]);
            this.tcapStack.setSlsRange(val);
        }
        else {
            return TCAPOAMMessage.INVALID_COMMAND;
        }

        return String.format(TCAPOAMMessage.PARAMETER_SUCCESSFULLY_SET, this.tcapStack.getName());
    }
228688
function BrowserStackSessionManager(options) {

  log.debug('[chimp][browserstack-session-manager] options are', options);

  var host = options.host.replace(/hub\.|hub-cloud\./, 'api.');
  var browserStackBaseUrl = 'https://' + options.user + ':' + options.key + '@' + host;
  options.browserStackUrl = browserStackBaseUrl;

  this.options = options;

  this.maxRetries = 30;
  this.retryDelay = 3000;
  this.retry = 0;

  // this will be set by the remote and multiremote methods from
  // desiredCapabilities
  this.buildName = null;

  log.debug('[chimp][browserstack-session-manager] created a new SessionManager', options);

}
642928
function({options}, succeed, skip) {
    var ssh;
    // SSH connection
    ssh = this.ssh(options.ssh);
    return each(options.should_exist).call(function(should_exist, next) {
      return fs.exists(ssh, should_exist, function(err, exists) {
        if (exists) {
          return next();
        } else {
          return next(Error(`File does not exist: ${should_exist}`));
        }
      });
    }).error(skip).next(succeed);
  }
1054526
function(options) {
		inputEx.FileField.superclass.setOptions.call(this, options);
		this.options.size = options.size;
		this.options.accept = options.accept;
	}
947101
function ( options ) {
			this.protocol = options.protocol || 'http';
			this.port = options.port;
			this.server = options.server;
			this.path = options.path;
			this.proxy = options.proxy;
			this.jar = request.jar(); // create new cookie jar for each instance

			this.debug = options.debug;

			// set up logging
			const winston = require( 'winston' ),
				// file logging
				path = require( 'path' ),
				fs = require( 'fs' ),
				logDir = path.dirname( process.argv[ 1 ] ) + '/log/',
				logFile = logDir + path.basename( process.argv[ 1 ], '.js' ) + '.log',
				// how many tasks (i.e. requests) to run in parallel
				concurrency = options.concurrency || 3;

			this.logger = new ( winston.Logger )();

			// console logging
			if ( this.debug ) {
				this.logger.add( winston.transports.Console, {
					level: 'debug'
				} );
			}

			this.logger.cli();

			if ( fs.existsSync( logDir ) ) {
				this.logger.add( winston.transports.File, {
					colorize: true,
					filename: logFile,
					json: false,
					level: this.debug ? 'debug' : 'info'
				} );
			}

			// requests queue
			// @see https://github.com/caolan/async#queue
			this.queue = async.queue( function ( task, callback ) {
			// process the task (and call the provided callback once it's completed)
				task( callback );
			}, concurrency );

			// HTTP client
			this.formatUrl = require( 'url' ).format;

			this.userAgent = options.userAgent || ( `nodemw/${VERSION} (node.js ${process.version}; ${process.platform} ${process.arch})` );
			this.version = VERSION;

			// debug info
			this.info( process.argv.join( ' ' ) );
			this.info( this.userAgent );

			let port = this.port ? `:${this.port}` : '';

			this.info( `Using <${this.protocol}://${this.server}${port}${this.path}/api.php> as API entry point` );
			this.info( '----' );
		}
310109
function executeCommand(cmd, option) {
    option = option || {};
    return new Promise((ac, rj)=>{
        let okMsg = '';
        let erMsg='';
        log('Exec:'+cmd.join(' '));
        let child;
        if (option.sudo) {
            child = sudo(cmd, {password: option.password});
        } else {
            child = spawn(cmd[0], cmd.slice(1));
        }
        child.stdout.on('data', (dat)=>{
            okMsg += dat.toString();
        });
        child.stderr.on('data', (dat)=>{
            erMsg += dat.toString();
        });
        child.on('close', (code)=>{
            if (code == 0) {
                ac(okMsg);
            } else {
                rj('Error in executing\n'
                   +'$ '+cmd.join(' ')+'\n\n'
                   + erMsg);
            }
        });
        child.on('error', (err)=>{
            rj(err);
        });
    });
}
912739
function(options) {
		var program = new Commander();
		if (options) {
			//hack to emulate process.argv
			options.unshift('', '');
		}
		//process short command names
		var args = options || process.argv.slice();
		var command = args[2];
		var validCommand = config.aliases[command];

		if (validCommand) {
			args[2] = validCommand;
		}
		program.parse(args);
	}
844751
def optparse(*args)
      opts = OptionParser.new

      opts.banner = 'usage: pullr URI [PATH]'

      opts.on('-S','--scm NAME','Source Code Management to use') do |scm|
        @scm = scm
      end

      opts.on('-U','--uri URI','The URI of the repository') do |uri|
        @uri = uri
      end

      opts.on('-u','--update [PATH]','Update the repository') do |path|
        @mode = :update
        @path = (path || Dir.pwd)
      end

      begin
        @args = opts.parse!(args)
      rescue OptionParser::InvalidOption => e
        $stderr.puts e.message
        $stderr.puts opts
        exit -1
      end
    end
825929
function Management(options) {
  /* eslint-disable */
  assert.check(
    options,
    { type: 'object', message: 'options parameter is not valid' },
    {
      domain: { type: 'string', message: 'domain option is required' },
      token: { type: 'string', message: 'token option is required' },
      _sendTelemetry: {
        optional: true,
        type: 'boolean',
        message: '_sendTelemetry option is not valid'
      },
      _telemetryInfo: {
        optional: true,
        type: 'object',
        message: '_telemetryInfo option is not valid'
      }
    }
  );
  /* eslint-enable */

  this.baseOptions = options;

  this.baseOptions.headers = { Authorization: 'Bearer ' + this.baseOptions.token };

  this.request = new RequestBuilder(this.baseOptions);
  this.baseOptions.rootUrl = urljoin('https://' + this.baseOptions.domain, 'api', 'v2');
}
1073956
function(file, options, callback) {
        var lines;
        fs.readFile(file, options, function(err, data) {
            if (err) {
                //err
                return callback(err);
            }
            if (/\r\n/.test(data.toString())) {
                lines = data.toString().split('\r\n');
            } else {
                lines = data.toString().split('\n');
            }
            if (module.exports.verify(lines[0])) {
                callback(undefined, lines);
            } else {
                callback("INVALID_SCC_FORMAT");
            }
        });
    }
591079
function uploadByDir(src, dest, client) {
    ClientLib.scp(src, dest, client,
        function (err) {
            if (err) {
                console.log(err);
            }
        }
    );
}
1154601
def scp(local_path, remote_path)
      resources.active.each do |resource|
        resource.put(local_path, remote_path)
      end
      return
    end
664669
function PeerOptions(options) {
  if (!(this instanceof PeerOptions))
    return new PeerOptions(options);

  this.network = Network.primary;
  this.logger = Logger.global;

  this.createSocket = tcp.createSocket;
  this.version = common.PROTOCOL_VERSION;
  this.services = common.LOCAL_SERVICES;
  this.agent = common.USER_AGENT;
  this.noRelay = false;
  this.spv = false;
  this.compact = false;
  this.headers = false;
  this.banScore = common.BAN_SCORE;

  this.getHeight = PeerOptions.getHeight;
  this.isFull = PeerOptions.isFull;
  this.hasWitness = PeerOptions.hasWitness;
  this.createNonce = PeerOptions.createNonce;
  this.hasNonce = PeerOptions.hasNonce;
  this.getRate = PeerOptions.getRate;

  if (options)
    this.fromOptions(options);
}
935791
function serverSecurityData(opt) {
	var self = {
		__TYPE__ : MessageType.SC_SECURITY,
		encryptionMethod : new type.UInt32Le(),
		encryptionLevel : new type.UInt32Le() 
	};
	
	return new type.Component(self, opt);
}