----------------------------------------------------------------------------- Utilities
508332
function getViewParams(url, view) {
  let match = view.regex.exec(url);
  if (match) {
    match.shift();
    return zip(view.params, match);
  } else {
    return null;
  }
}
477952
function (name) {
            var utility = utilities[name];

            if (utility) {
                if (!utility.instance) {
                    utility.instance = utility.creator(this);
                }

                return utility.instance;
            }

            return null;
        }
849139
function Stream(options) {

  /**
   * Whether or not the Stream was initialized as
   * a single- or multi-key stream.
   *
   * @property multi
   * @type Boolean
   */
  reader(this, 'multi', !(options && options.apiKey));

  if (!this.multi) {
    options.headers = options.headers || {};
    options.headers['Zotero-API-Key'] = options.apiKey;

    delete options.apiKey;
  }

  Client.call(this, options);

  /**
   * @property retry
   * @type Object
   */
  reader(this, 'retry', {
    delay: Stream.DEFAULT_RETRY
  });

  /**
   * @property idle
   * @type Object
   */
  reader(this, 'idle', {
    ping: Stream.IDLE_TIMEOUT,
    pong: Stream.IDLE_TIMEOUT / 2
  });

  /**
   * @property subscriptions
   * @type Subscriptions
   */
  this.subscriptions = new Subscriptions();

  this.open = this.open.bind(this);
  this.opened = this.opened.bind(this);
  this.closed = this.closed.bind(this);
  this.ping = this.ping.bind(this);
  this.pong = this.pong.bind(this);
  this.receive = this.receive.bind(this);
  this.error = this.error.bind(this);

  this.open();
}
151949
function () {
            var res = this.__resources;
            if (!res) {
                var src = this.$resources;
                if (src) {
                    this.__resources = res = {};
                    for (var itm in src) {
                        if (src.hasOwnProperty(itm)) {
                            res[itm] = this[itm];
                        }
                    }
                }
            }
            return res;
        }
1299123
function Wire(options) {
  if (!(this instanceof Wire)) return new Wire(options);

  var opts = options || {};

  this.__co = opts.co || require('co');
  this.__p = opts.p || Promise;

  this.__hooks          = {};
  this.__handlers       = [];
  this.__sortedCache    = [];
  this.__knownChannels  = {};
  this.__skips          = {};
}
118507
def create_utilities(self):
        
        self.create_stack(
            self.utilities_name,
            'amazon-utilities.yaml',
            parameters=define_parameters(
                Subnets=self.subnet_ids,
                NodeSecurityGroup=self.node_security_group
            )
        )
765877
function Stream (options) {

  //check options
  if (!options) {

    throw new Error('Initialization error: missing transport options')
  }

  this._initDefaults() //Initialize default params
  this._updateParams(options)
  this._initTransport(options.transport)

  var self = this

  self.on('error', nop)

  this.subscriptions = []

  this.getSubscriptions = function () {

    return this.subscriptions
  }

  this.addSubscription = function (args, callback) {

    var c = new Subscription(args, callback, this)
    this.subscriptions[c.eid] = c
    return c
  }

  this.getSubscription = function (channel, resource) {

    if (this.subscriptions[channel + this.seperator + resource]) {
      return this.subscriptions[channel + this.seperator + resource]
    }
    return null
  }

  this.getAnySubscription = function (channel, resource) {

    if (this.subscriptions[channel + this.seperator + resource]) {
      return this.subscriptions[channel + this.seperator + resource]
    } else if (this.subscriptions[channel + this.seperator + this.wildcard]) {
      return this.subscriptions[channel + this.seperator + this.wildcard]
    } else {
      return null
    }
  }

  this.removeSubscription = function (channel, resource) {

    resource = resource || this.wildcard
    if (this.subscriptions[channel + this.seperator + resource]) {
      var retval = this.subscriptions[channel + this.seperator + resource]
      delete this.subscriptions[channel + this.seperator + resource]
      return retval
    }

    return null
  }

  this.getSubscriptionWithPermission = function (channel, resource, read, write) {

    var Subscription = this.subscriptions[channel + this.seperator + resource]
    var match = false

    if (Subscription) {

      match = true

      if (read) {
        match = Subscription.hasReadPermission()
      }

      if (write) {
        match = Subscription.hasWritePermission()
      }

      if (match) {
        return Subscription
      }
    } else {

      Subscription = this.subscriptions[channel + this.seperator + this.wildcard]

      if (Subscription) {

        match = true

        if (read) {
          match = Subscription.hasReadPermission()
        }

        if (write) {
          match = Subscription.hasWritePermission()
        }

        if (match) {
          return Subscription
        }
      }
    }

    return null
  }

  this.connection = new this.ConnectionFactory(this)
  this.connect()
}
683874
@Override
    protected void configure() {

        install(new com.englishtown.promises.hk2.WhenBinder());

        bind(VertxExecutor.class).to(Executor.class).in(Singleton.class).ranked(10);

        bind(DefaultWhenVertx.class).to(WhenVertx.class).in(Singleton.class);
        bind(DefaultWhenEventBus.class).to(WhenEventBus.class).in(Singleton.class);
        bind(DefaultWhenHttpClient.class).to(WhenHttpClient.class).in(Singleton.class);
        bind(DefaultWhenFileSystem.class).to(WhenFileSystem.class).in(Singleton.class);
        bind(DefaultPromiseAdapter.class).to(PromiseAdapter.class).in(Singleton.class);

    }
1118432
function createAdapterUtilitiesMock() {
   const utilities = {};
   [ 'unknownWidget', 'unknownInjection', 'activityAccessingDom' ].forEach( method => {
      utilities[ method ] = jasmine.createSpy( method ).and.returnValue( new Error() );
   } );
   return utilities;
}
535923
function stream(opts) {
  opts = lo.isObject(opts) ? opts : {}
  config.input = opts.input || process.stdin
  config.output = opts.output || process.stdout
}
938915
public void initImpl()
  {
    if (_level == null) {
      return;
    }
    
    if (_names.size() == 0) {
      _names.add("");
    }
    
    for (String name : _names) {
      _logger = Logger.getLogger(name);
    
      if (_level != null) {
        _logger.setLevel(_level);
      }

      if (_useParentHandlers != null) {
        _logger.setUseParentHandlers(_useParentHandlers.booleanValue());
      }
    
      for (Handler handler : _handlerList) {
        _logger.addHandler(handler);
      }
    
      if (_filter != null) {
        _logger.setFilter(_filter);
      }
    }
  }
1028661
function(options) {
  "use strict";
  stream.Transform.call(this, options);

  options = options || {};

  this.probability = options.probability || 0;
  this.deviation = Math.abs(options.deviation || 0);

  this.whiteList = options.whiteList || [];
  this.blackList = options.blackList || [];
  this.func = options.func;
}
540942
function Stream( value, options ) {
		if ( !arguments.length ) {
			throw new Error( 'Stream()::insufficient input arguments. Must provide a value to append.' );
		}
		if ( arguments.length < 2 ) {
			options = {};
		}
		if ( !( this instanceof Stream ) ) {
			return new Stream( value, options );
		}
		var err = validate( options );
		if ( err ) {
			throw err;
		}

		Transform.call( this, options );
		this._val = value.toString();
		this._destroyed = false;

		return this;
	}
237880
function(options) {
    var self = this;

    self.setMaxListeners(0);

    self.options            = (typeof options != 'undefined') ? options : {};
    var loggerClass         = self.options.loggerClass || require('./modules/logger');
    self.logger             = new loggerClass(options);
    self.options.options    = self.options.options || {};
    self.options.connection = self.options.connection || {};
    self.debugDetails       = (self.options.options && (typeof self.options.options.debugDetails != 'undefined')) ? self.options.options.debugDetails : false;
    self.emitSelf           = (self.options.options && (typeof self.options.options.emitSelf != 'undefined')) ? self.options.options.emitSelf : false;
    self.reconnect          = (typeof self.options.connection.reconnect != 'undefined') ? self.options.connection.reconnect : true;
    self.stream             = stream.createStream({ parsePrefix: true }).on('data', this._handleMessage.bind(this));
    self.socket             = null;
    self.connected          = false;
    self.currentChannels    = [];
    self.lastPing           = new Date();
    self.latency            = new Date();
    self.moderators         = {};
    self.myself             = '';
    self.port               = 443;
    self.server             = 'irc.twitch.tv';
    self.twitchClient       = self.options.options.tc || 0;
    self.selfData           = {};
    self.userData           = {};

    self.gracefulReconnection = false;

    self.logger.dev('Created a new client instance on pid ' + process.pid);
    self.logger.dev('Memory rss: ' + process.memoryUsage().rss);
    self.logger.dev('Memory heap total: ' + process.memoryUsage().heapTotal);
    self.logger.dev('Memory heap used : ' + process.memoryUsage().heapUsed);

    var exitOnError = (self.options.options && (typeof self.options.options.exitOnError != 'undefined')) ? self.options.options.exitOnError : true;

    process.on('uncaughtException', function (err) {
        self.logger.crash(err.stack);
        self.emit('crash', err.message, err.stack);
        if (exitOnError) { process.exit(); }
    });

    // Making sure the client connection is still alive..
    setInterval(function() {
        if (self.connected) {
            if (((new Date()-self.lastPing)/1000) > 360) {
                self.socket.forceDisconnect(false);
                if (self.reconnect) { setTimeout(function() {self.connect();}, 2000); }
            }
        }
    }, 10000);

    events.call(self);
}
377162
@Override
	public void setup(StreamTask<?, ?> containingTask, StreamConfig config, Output<StreamRecord<OUT>> output) {
		super.setup(containingTask, config, output);
		FunctionUtils.setFunctionRuntimeContext(userFunction, getRuntimeContext());

	}
1169077
function(namespace, ressource, args, options) {
            var d = Q.defer();
            var namespace_configs = _.extend({}, Resources.namespaces[namespace] || {}, options || {});
            var loader = namespace_configs.loader || namespace;
            
            if (Resources.loaders[loader] == null) {
                logging.error("Loader doesn't exists ", loader, "namespace=",namespace);
                d.reject();
                return d.promise;
            }
            Resources.loaders[loader](ressource, d, args, namespace_configs);
            return d.promise;
        }
1035779
private function _power()
    {
        foreach ($this->_lines as $line) {
            $buffer = preg_split("/\s*\|\s*/", $line);
            if ($buffer[2] == "Current" && $buffer[11] != "N/A" && $buffer[4] == "W") {
                $dev = new SensorDevice();
                $dev->setName($buffer[1]);
                $dev->setValue($buffer[3]);
                if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
                if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11], "'"));
                $this->mbinfo->setMbPower($dev);
            }
        }
    }