Returns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
345919
def configuration_to_dict(handlers):
    
    config_dict = defaultdict(dict)

    for handler in handlers:
        for option in handler.set_options:
            value = _get_option(handler.target_obj, option)
            config_dict[handler.section_prefix][option] = value

    return config_dict
910005
def _threads(self, handlers):
        
        if self.threads < len(handlers):
            return self.threads
        return len(handlers)
768593
def get_configs(self):
        
        self.bots.check_models_ready()
        for config in self.configs.values():
            yield config
236735
def get_default_config_help(self):
        
        config = super(RiemannHandler, self).get_default_config_help()

        config.update({
            'host': '',
            'port': '',
            'transport': 'tcp or udp',
        })

        return config
563594
def dispatch(self, *args, **kwargs):
        
        called_handlers = set()
        for handler_list in self.handlers.values():
            for handler, argspec in handler_list:
                accept_args, accept_kwargs = argspec.accepts
                if handler in called_handlers and False:
                    continue
                else:
                    if args_match(accept_args, accept_kwargs, self.default, *args, **kwargs):
                        called_handlers.add(handler)
                        handler(*args, **kwargs)
        
        return called_handlers
749074
def GetHandlers(self):
    
    handlers = []

    if self.ssl_context:
      handlers.append(urllib2.HTTPSHandler(context=self.ssl_context))

    if self.proxies:
      handlers.append(urllib2.ProxyHandler(self.proxies))

    return handlers
498572
def get_default_config(self):
        
        config = super(SentryHandler, self).get_default_config()

        config.update({
            'dsn': '',
        })

        return config
1192813
def get_default_config_help(self):
        
        config = super(SentryHandler, self).get_default_config_help()

        config.update({
            'dsn': '',
        })

        return config
12116
def get_default_config(self):
        
        config = super(MQTTHandler, self).get_default_config()

        config.update({
        })

        return config
1357692
@SuppressWarnings("rawtypes")
    public static List<Handler> sortHandlers(List<Handler> handlers) {

        List<LogicalHandler<?>> logicalHandlers = new ArrayList<LogicalHandler<?>>();
        List<Handler<?>> protocolHandlers = new ArrayList<Handler<?>>();

        for (Handler<?> handler : handlers) {
            if (handler instanceof LogicalHandler) {
                logicalHandlers.add((LogicalHandler<?>) handler);
            } else {
                protocolHandlers.add(handler);
            }
        }

        List<Handler> sortedHandlers = new ArrayList<Handler>(logicalHandlers.size() + protocolHandlers.size());
        sortedHandlers.addAll(logicalHandlers);
        sortedHandlers.addAll(protocolHandlers);
        return sortedHandlers;
    }
629580
def create_handlers_map(prefix='.*'):
  
  return [
      (prefix + '/output', _BarrierHandler),
      (prefix + '/run', _PipelineHandler),
      (prefix + '/finalized', _PipelineHandler),
      (prefix + '/cleanup', _CleanupHandler),
      (prefix + '/abort', _PipelineHandler),
      (prefix + '/fanout', _FanoutHandler),
      (prefix + '/fanout_abort', _FanoutAbortHandler),
      (prefix + '/callback', _CallbackHandler),
      (prefix + '/rpc/tree', status_ui._TreeStatusHandler),
      (prefix + '/rpc/class_paths', status_ui._ClassPathListHandler),
      (prefix + '/rpc/list', status_ui._RootListHandler),
      (prefix + '(/.+)', status_ui._StatusUiHandler),
      ]
980789
def _get_handlers(self):
        
        # 查找所有 Handler。
        members = {}
        for d in __conf__.ACTION_DIR_NAME:
            members.update(get_members(d,
                           None,
                           lambda m: isclass(m) and issubclass(m, BaseHandler) and hasattr(m, "__urls__") and m.__urls__))

        # 分解 __urls__ 配置。
        handlers = [(pattern, order, h) for h in members.values() for pattern, order in h.__urls__]

        # 排序。
        # handlers.sort(cmp = cmp, key = lambda x: x[1])

        try:
            api_version = __conf__.API_VERSION
        except Exception as e:
            api_version = ''

        handlers = [(api_version + pattern, handler) for pattern, _, handler in handlers]

        handlers.append((r'^/(.*?)$', tornado.web.StaticFileHandler, {"path":"static", "default_filename":"index.html"}))
        return handlers
1364300
def u2handlers(self):
        
        handlers = []
        handlers.append(u2.ProxyHandler(self.proxy))
        return handlers
132869
def get_handler_classes(self):
        """"""

        handler_classes = [import_string(handler_cls) for handler_cls in settings.MODERNRPC_HANDLERS]

        if self.protocol == ALL:
            return handler_classes
        else:
            return [cls for cls in handler_classes if cls.protocol in ensure_sequence(self.protocol)]
574935
def get_handlers(self, component_context, instance):
        
        # Extract information from the context
        configs = component_context.get_handler(
            ipopo_constants.HANDLER_TEMPORAL
        )
        requires_filters = component_context.properties.get(
            ipopo_constants.IPOPO_REQUIRES_FILTERS, None
        )
        temporal_timeouts = component_context.properties.get(
            ipopo_constants.IPOPO_TEMPORAL_TIMEOUTS, None
        )

        # Prepare requirements
        new_configs = self._prepare_configs(
            configs, requires_filters, temporal_timeouts
        )

        # Return handlers
        return [
            TemporalDependency(field, requirement, timeout)
            for field, (requirement, timeout) in new_configs.items()
        ]
1065969
def to_dict(self):
        ''''''
        d = {'id': self.id}
        data = []
        for c in self._config_data:
            data.append(c.to_dict())
        if data:
            d['configurationData'] = data
        return d
596275
def get_handlers(self, event: str) -> T.List[T.Callable]:
        """"""

        return list(self._events.get(event, []))