generates a reql cursor for plugin_name
    with status ready
    and prepares to sort by StartTime
    :param plugin_name:
    :param location:
    :param port:
    :return:
14675
def _jobs_cursor(plugin_name, location=None, port=None, custom=None):
    
    cur = RBJ.get_all(READY, index=STATUS_FIELD)
    cur_filter = (r.row[TARGET_FIELD][PLUGIN_NAME_KEY] == plugin_name)
    cur_filter = cur_filter & \
                 (~r.row.has_fields(EXPIRE_FIELD) |
                  r.row[EXPIRE_FIELD].ge(time()))
    if location:
        cur_filter = cur_filter & \
                     (r.row[TARGET_FIELD][LOCATION_FIELD] == location)
    if port:
        cur_filter = cur_filter & \
                     (r.row[TARGET_FIELD][PORT_FIELD] == port)
    if custom:
        cur_filter = cur_filter & custom
    return cur.filter(cur_filter).order_by(START_FIELD)
1031147
def pluginNames(cls, enabled=True):
        
        return map(lambda x: x.name(), cls.plugins(enabled))
728085
def with_wait_cursor(func):
    
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        QApplication.setOverrideCursor(
            QCursor(Qt.WaitCursor))
        try:
            ret_val = func(*args, **kwargs)
        finally:
            QApplication.restoreOverrideCursor()
        return ret_val
    return wrapper
145101
def instance_get(plugin, opts, url_file_input, out):
    
    inst = plugin()
    hp, func, enabled_func = inst._general_init(opts, out)
    name = inst._meta.label

    kwargs = {
        'hide_progressbar': hp,
        'functionality': func,
        'enabled_functionality': enabled_func
    }

    if url_file_input:
        del kwargs['hide_progressbar']

    return {
        'inst': inst,
        'kwargs': kwargs
    }
516674
function (server_name, onDone) {

	// check if cached server info exists	
	if (l_servers.hasOwnProperty(server_name)) {
		var server = l_servers[server_name];
		
		LOG.warn('cache exists: ', 'Entry');
		LOG.warn(server, 'Entry');
		UTIL.safeCall(onDone, server);
	}
	else {
		
		// seek server IP/port info from monitor
		//l_queryServer(server_name, function (result) {
		//SR.Script['handler'].queryServer(server_name, function (result) {
		//g_handler.queryServer(server_name, function (result) {
		SR.API.queryServer({name: server_name}, function (err, result) {
			
			if (err) {
				return LOG.error(err);	
			}
			
			if (result && result.length > 0) {
				// TODO: pick a random one if more than one choices OR choose based on loading?
				var index = UTIL.randInteger(result.length);
				var info = result[index];
			
				var server = {IP: info.IP, port: info.port}
				l_servers[server_name] = server;
				onDone(server);
			}
			else
				onDone();
		});
	}	
}
1023617
def _serve_plugins_listing(self, request):
    
    response = {}
    for plugin in self._plugins:
      start = time.time()
      response[plugin.plugin_name] = plugin.is_active()
      elapsed = time.time() - start
      logger.info(
          'Plugin listing: is_active() for %s took %0.3f seconds',
          plugin.plugin_name, elapsed)
    return http_util.Respond(request, response, 'application/json')
1030160
def get_targets_by_plugin(plugin_name, conn=None):
    
    targets = RBT
    results = targets.filter({PLUGIN_NAME_KEY: plugin_name}).run(conn)
    for item in results:
        yield item
1055407
def get_port_by_name(self, port_name):
        ''''''
        with self._mutex:
            for p in self.ports:
                if p.name == port_name:
                    return p
            return None
1019888
def _query(action=None,
           command=None,
           args=None,
           method='GET',
           header_dict=None,
           data=None,
           url='https://api.linode.com/'):
    '''
    
    '''
    global LASTCALL
    vm_ = get_configured_provider()

    ratelimit_sleep = config.get_cloud_config_value(
        'ratelimit_sleep', vm_, __opts__, search_global=False, default=0,
    )
    apikey = config.get_cloud_config_value(
        'apikey', vm_, __opts__, search_global=False
    )

    if not isinstance(args, dict):
        args = {}

    if 'api_key' not in args.keys():
        args['api_key'] = apikey

    if action and 'api_action' not in args.keys():
        args['api_action'] = '{0}.{1}'.format(action, command)

    if header_dict is None:
        header_dict = {}

    if method != 'POST':
        header_dict['Accept'] = 'application/json'

    decode = True
    if method == 'DELETE':
        decode = False

    now = int(time.mktime(datetime.datetime.now().timetuple()))
    if LASTCALL >= now:
        time.sleep(ratelimit_sleep)

    result = __utils__['http.query'](
        url,
        method,
        params=args,
        data=data,
        header_dict=header_dict,
        decode=decode,
        decode_type='json',
        text=True,
        status=True,
        hide_fields=['api_key', 'rootPass'],
        opts=__opts__,
    )

    if 'ERRORARRAY' in result['dict']:
        if result['dict']['ERRORARRAY']:
            error_list = []

            for error in result['dict']['ERRORARRAY']:
                msg = error['ERRORMESSAGE']

                if msg == "Authentication failed":
                    raise SaltCloudSystemExit(
                        'Linode API Key is expired or invalid'
                    )
                else:
                    error_list.append(msg)
            raise SaltCloudException(
                'Linode API reported error(s): {}'.format(", ".join(error_list))
            )

    LASTCALL = int(time.mktime(datetime.datetime.now().timetuple()))
    log.debug('Linode Response Status Code: %s', result['status'])

    return result['dict']
1306158
async def _start_plugins(self) -> None:
        
        logger.debug('Starting plugins')
        for priority in sorted(self._start_priority, reverse=True):
            logger.debug(
                'Starting plugins %s',
                ', '.join(self._start_priority[priority])
            )

            for name in self._start_priority[priority]:
                plugin = self._plugins[name]
                self._tasks[name] = self._loop.create_task(
                    plugin['plugin'].start()
                )

            while not all(self._plugins[name]['plugin'].started
                          for name in self._tasks):

                for task in self._tasks.values():
                    if task.done():
                        task.result()
                await asyncio.sleep(0.2, loop=self._loop)

            else:
                logger.debug('Plugins %s started',
                             ', '.join(self._start_priority[priority]))
430199
def enable(self, timeout=0):
        
        self.client.api.enable_plugin(self.name, timeout)
        self.reload()
1317450
def plugin_is_enabled(name, runas=None):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    return name in list_enabled_plugins(runas)
208741
def onSettingsChange(self, plugin_name, data):
        
        logger.info(u"onSettingsChange: {}".format(data))
        if not plugin_name:
            logger.error("Missing plugin name")
            return
        if not data:
            logger.error("Missing data")
            return
        logger.info(u"Sending data {}".format(data))
        reactor.callFromThread(self._sendJSON, {
            'msg': "plugin_data_set",
            'plugin_name': plugin_name,
            'data': data
        })
        # trigger db update
        reactor.callFromThread(self._sendJSON, {
            'msg': "plugin_data_get",
            'plugin_name': plugin_name
        })
1095641
def on_plugin_action_menu_requested(self, pos):
        

        index = self.data["views"]["right"].indexAt(pos)
        actions = index.data(model.Actions)

        if not actions:
            return

        menu = QtWidgets.QMenu(self)
        plugins_index = self.data["models"]["filter"].mapToSource(index)
        plugin = self.data["models"]["plugins"].items[plugins_index.row()]
        print("plugin is: %s" % plugin)

        for action in actions:
            qaction = QtWidgets.QAction(action.label or action.__name__, self)
            qaction.triggered.connect(partial(self.act, plugin, action))
            menu.addAction(qaction)

        menu.popup(self.data["views"]["right"].viewport().mapToGlobal(pos))
678723
def get(self, name):
        """"""
        try:
            return self.plugins[name]
        except KeyError:
            raise RuntimeError("plugin {} does not exist".format(name))
352000
def get_frontend_aware_plug_names(self):
    """"""
    return [name for name, plug in six.iteritems(self._plugs_by_name)
            if isinstance(plug, FrontendAwareBasePlug)]
1067226
void choosePaginationPlugin(Context context) {
    DatabaseType type = detectDB(context);
    PluginConfiguration pluginConfiguration = new PluginConfiguration();
    switch (type) {
      case MYSQL:
        pluginConfiguration.setConfigurationType(MySqlPaginationPlugin.class.getTypeName());
        context.addPluginConfiguration(pluginConfiguration);
        if (verbose) getLog().info("enable pagination service with mysql for context " + context.getId());
        break;
      case POSTGRESQL:
        pluginConfiguration.setConfigurationType(PostgreSQLPaginationPlugin.class.getTypeName());
        context.addPluginConfiguration(pluginConfiguration);
        if (verbose) getLog().info("enable pagination service with postgresql for context " + context.getId());
        break;
      case SQLSERVER:
        pluginConfiguration.setConfigurationType(SQLServerPaginationPlugin.class.getTypeName());
        context.addPluginConfiguration(pluginConfiguration);
        if (verbose) getLog().info("enable pagination service with sqlserver for context " + context.getId());
        break;
      case DB2:
        pluginConfiguration.setConfigurationType(DB2PaginationPlugin.class.getTypeName());
        context.addPluginConfiguration(pluginConfiguration);
        if (verbose) getLog().info("enable pagination service with db2 for context " + context.getId());
        break;
      case ORACLE:
        pluginConfiguration.setConfigurationType(OraclePaginationPlugin.class.getTypeName());
        context.addPluginConfiguration(pluginConfiguration);
        if (verbose) getLog().info("enable pagination service with oracle for context " + context.getId());
        break;
      case HSQLDB:
        pluginConfiguration.setConfigurationType(HsqldbPaginationPlugin.class.getTypeName());
        context.addPluginConfiguration(pluginConfiguration);
        if (verbose) getLog().info("enable pagination service with hsqldb for context " + context.getId());
        break;
    }
  }