Represents a Marathon Event Bus Client
@constructor
@param {object} options - The option map object.
438492
function MarathonEventBusClient (options) {

    if (!(this instanceof MarathonEventBusClient)) {
        return new MarathonEventBusClient(options);
    }

    // Inherit from EventEmitter
    EventEmitter.call(this);

    let self = this;

    // See https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/core/event/Events.scala
    self.allowedEventTypes = [
      "pod_created_event","pod_updated_event", "pod_deleted_event","scheduler_registered_event", "scheduler_reregistered_event", "scheduler_disconnected_event", "subscribe_event", "unsubscribe_event", "event_stream_attached", "event_stream_detached", "add_health_check_event", "remove_health_check_event", "failed_health_check_event", "health_status_changed_event", "unhealthy_task_kill_event", "group_change_success", "group_change_failed", "deployment_info", "deployment_success", "deployment_failed", "deployment_step_success", "deployment_step_failure", "app_terminated_event", "status_update_event", "instance_changed_event", "unknown_instance_terminated_event", "instance_health_changed_event", "framework_message_event"
    ];

    // Default allowed headers
    self.allowedHeaders = [
      "Content-Type", "Authorization"
    ];

    // Options dict
    self.options = {};

    // Marathon endpoint discovery
    self.options.marathonHost = options.marathonHost || "master.mesos";
    self.options.marathonPort = parseInt(options.marathonPort) || 8080;
    self.options.marathonProtocol = options.marathonProtocol || "http";
    self.options.marathonUri = options.marathonUri || "/v2/events";
    
    // Whether to emit a "connectionId" event
    self.options.enableConnectionEvent = options.enableConnectionEvent || false;

    // Set the used eventTypes
    if (options.eventTypes && options.eventTypes.length > 0) {
        self.options.eventTypes = [];
            options.eventTypes.forEach(function (eventType) {
            if (self.allowedEventTypes.indexOf(eventType) > -1) {
                self.options.eventTypes.push(eventType);
            }
        });
    } else {
        // Just use the deployment events by default, to avoid channel flooding
        self.options.eventTypes = ["deployment_info", "deployment_success", "deployment_failed"];
    }

    // Custom headers dict
    self.options.marathonHeaders = {};

    // Set custom headers if present
    if (options.marathonHeaders && Object.getOwnPropertyNames(options.marathonHeaders).length > 0) {
        Object.getOwnPropertyNames(options.marathonHeaders).forEach(function (key) {
          if(self.allowedHeaders.indexOf(key) > -1) {
            self.options.marathonHeaders[key] = options.marathonHeaders[key];
          }
        });
    }

    // Add connectionId event if enabled
    if (self.options.enableConnectionEvent) {
        self.options.eventTypes.push("connectionId");
    }

    // Usable to check if the function argument is a function itself
    function isFunction(obj) {
        return !!(obj && obj.constructor && obj.call && obj.apply);
    }

    // Event handlers
    self.options.eventHandlers = {};

    // Add custom event handlers if present
    if (options.handlers && Object.getOwnPropertyNames(options.handlers).length > 0) {
        Object.getOwnPropertyNames(options.handlers).forEach(function (handlerName) {
            const lcHandlerName = handlerName.toLowerCase();
            // Check if name is in defined event types, is a function
            if (self.options.eventTypes.indexOf(lcHandlerName) > -1 && isFunction(options.handlers[handlerName])) {
                self.options.eventHandlers[lcHandlerName] = function (name, data) {
                    // Emit according event
                    self.emit(name, data);
                    // Call custom event handler
                    options.handlers[handlerName](name, data);
                }
            }
        });
    }

    // Check if an event handlers has been defined for each event type
    self.options.eventTypes.forEach(function (eventType) {
        // If there's no event handler defined yet, set a default event handler which just prints the event name
        if (!self.options.eventHandlers.hasOwnProperty(eventType)) {
            self.options.eventHandlers[eventType] = function (name, data) {
                // Emit according event
                self.emit(name, data);
                // Log event name
                console.log("Default handler for " + name + ". Do nothing.");
            }
        }
    });

}
167695
function evt(options) {
    this.interval = options.interval || 5000;
    this.events = options.events;
    this.handle = null;
}
150149
function ReadableUSBStream(endpoint, options)
{
	stream.Readable.call(this, options);

	this.endpoint = endpoint;
	this.endpoint.addListener('data', this.onData.bind(this));
	this.endpoint.addListener('error', this.onError.bind(this));
	this.endpoint.addListener('end', this.onEnd.bind(this));

	this.paused = true;
}
390989
function (options) {
        W.extend(this, W.eventMixin);
        this.socketUrl = options.socketUrl;
        this._connectionDesired = false;
        this.attemptReconnectionAfterMS = (typeof options.attemptReconnectionAfterMS !== 'undefined') ? options.attemptReconnectionAfterMS : 10000;
    }
961969
function GELFManager(options) {

  if (typeof options === 'undefined') options = {};
  for (k in GELFManager.options)
    if (typeof options[k] === 'undefined')
      options[k] = GELFManager.options[k];

  this.debug        = options.debug;
  this.chunkTimeout = options.chunkTimeout;
  this.gcTimeout    = options.gcTimeout;

  EventEmitter.call(this);
  this.chunksPool = {};

  process.nextTick(this._gc.bind(this));

}
547279
function NodeMqttTransport(options) {
  Transport.call(this, options);

  this._options = options;
  this._client = null;
  this._sendTimer = null;
  this._buf = [];

  this._status = '';

  this._connHandler = onConnect.bind(this);
  this._messageHandler = onMessage.bind(this);
  this._sendOutHandler = sendOut.bind(this);
  this._disconnHandler = onDisconnect.bind(this);
  this._errorHandler = onError.bind(this);

  init(this);
}
773220
function(options) {
      
      inputEx.TimeIntervalField.superclass.setOptions.call(this,options);
      
      var units = inputEx.TimeIntervalField.units;
      var unitsStr = inputEx.messages.timeUnits;
      
      this.options.unit = options.unit || units.SECOND;
      
      
      var n=[]; for(var i=1;i<=60;i++){ n.push({ value : i }); }
      
      this.options.fields = options.fields || [
         {type: 'select', choices: n },
         {
            type: 'select',
            choices: [
               { value: units.SECOND, label: unitsStr.SECOND },
               { value: units.MINUTE, label: unitsStr.MINUTE },
               { value: units.HOUR, label: unitsStr.HOUR },
               { value: units.DAY, label: unitsStr.DAY },
               { value: units.MONTH, label: unitsStr.MONTH },
               { value: units.YEAR, label: unitsStr.YEAR }
            ]
         }
      ];
      
      this.options.separators = options.separators || [false, "&nbsp;&nbsp;", false];
   }
241252
function ChainOptions(options) {
  if (!(this instanceof ChainOptions))
    return new ChainOptions(options);

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

  this.prefix = null;
  this.location = null;
  this.db = 'memory';
  this.maxFiles = 64;
  this.cacheSize = 32 << 20;
  this.compression = true;
  this.bufferKeys = ChainDB.layout.binary;

  this.spv = false;
  this.bip91 = false;
  this.bip148 = false;
  this.prune = false;
  this.indexTX = true;
  this.indexAddress = true;
  this.forceFlags = false;

  this.coinCache = 0;
  this.entryCache = 5000;
  this.maxOrphans = 20;
  this.checkpoints = true;

  this.blockNotify = null;
  this.subscribeCmd = null;

  if (options)
    this.fromOptions(options);
}
624230
function PointerEvent(options) {
    var _this = this;

    _classCallCheck(this, PointerEvent);

    this.startHandlers = {};
    this.lastHandlerId = 0;
    this.curPointerClass = null;
    this.curTouchId = null;
    this.lastPointerXY = { clientX: 0, clientY: 0 };
    this.lastTouchTime = 0;

    // Options
    this.options = { // Default
      preventDefault: true,
      stopPropagation: true
    };
    if (options) {
      ['preventDefault', 'stopPropagation'].forEach(function (option) {
        if (typeof options[option] === 'boolean') {
          _this.options[option] = options[option];
        }
      });
    }
  }
448823
function(options) {
    if (typeof options === 'undefined') {
      throw new Error('new StreamChannels(options) - options parameter missing');
    }
    else if (typeof options.track === 'undefined') {
      throw new Error('new StreamChannels(options) - options.track parameter missing');
    }
    else if (!(typeof options.track === 'object' || typeof options.track === 'string')) {
      throw new Error('new StreamChannels(options) - options.track must be an Object (representing your channels with there keywords), an Array (of keywords) or a String (with comma separeted keywords)');
    }
  }
266977
function IteratorOptions(options) {
  this.keys = true;
  this.values = true;
  this.start = null;
  this.end = null;
  this.gt = false;
  this.lt = false;
  this.keyAsBuffer = true;
  this.valueAsBuffer = true;
  this.reverse = false;
  this.limit = -1;

  if (options)
    this.fromOptions(options);
}
922362
function WSPool(bus, options) {
  events.EventEmitter.call(this);
  this.setMaxListeners(0);
  this.bus = bus;
  this.logger = bus.logger.withTag(bus.id+':wspool');
  this.closed = false;
  this.pool = {};
  this.notificationChannels = {};

  this.options = options || {};
  this.options.secret = this.options.secret || 'notsosecret';

  if (!this.options.poolSize || this.options.poolSize <= 0) {
    this.options.poolSize = 10;
  }

  this.options.replaceDelay = this.options.replaceDelay || 5000;
  this.options.urls = this.options.urls || [];

  this._setupPool();
}
1307741
function Server(server, options)
{
	events.EventEmitter.call(this);
	
	this.listen = function(options, callback) {
		server.listen(options, callback);
	};
	
	server.on('connection', (socket) => {
		options = options || {};
		options.isServer = true;
		this.emit('client', new Client(socket, options));
	});
}
497695
function( options ) {
  this.options = options;
  this.wpt = new WPT( this.options.wpt.server );

  this.data  = [];
  this.queue = new Queue();
}
484010
function(options) {
    
    // Call super class.
    EventEmitter.call(this);
    
    // Set options and load defaults if needed.
    this.options = options || {};
    
    this.host = this.options.host || 'localhost';
    this.port = this.options.port || 5672;
    this.protocol = this.options.protocol || 'amqp';
    this.login = this.options.login;
    this.password = this.options.password;
    this.vhost = this.options.vhost;
    this.task = this.options.task;

    this.url = this.protocol + '://';
    if (this.login && this.password) {
        this.url += this.login + ':' + this.password + '@';
    }
    this.url += this.host;
    if (this.port) {
        this.url += ':' + this.port;
    }
    if (this.vhost) {
        this.url += this.vhost;
    }

}
373755
function Broker(options) {
  EventEmitter.call(this);
  this._exchange = null;
  this._queues = {};
  this._ctags = {};
  
  this._options = options;
}
1185830
function FederationServer(bus, options) {
  events.EventEmitter.call(this);
  this.bus = bus;
  this.logger = bus.logger.withTag(bus.id + ':fedserver');
  this._options(options);
}