Register function in the system namespace. Called by Services.
184941
def register_service_functions(self, *funcs):
        
        for func in funcs:
            self.namespace[func.__name__] = func
1321901
def register_namespace(self, namespace_handler):
        
        if not isinstance(namespace_handler, namespace.Namespace):
            raise ValueError('Not a namespace instance')
        if self.is_asyncio_based() != namespace_handler.is_asyncio_based():
            raise ValueError('Not a valid namespace class for this server')
        namespace_handler._set_server(self)
        self.namespace_handlers[namespace_handler.namespace] = \
            namespace_handler
910891
def registered? name
      registration_map = namespaces.map do |namespace|
        registered_in_namespace? name, namespace
      end
      registration_map.any?
    end
315486
def register(self, func, singleton=False, threadlocal=False, name=None):
        
        func._giveme_singleton = singleton
        func._giveme_threadlocal = threadlocal

        if name is None:
            name = func.__name__
        self._registered[name] = func
        return func
741723
def register(self, name):
        """"""
        def decorator(func):
            """Register decorated function."""
            self[name] = func
            return func

        return decorator
269839
def register(self, value):
        
        if self.env is None:
            raise PluginException('The plugin must be installed to application.')

        def wrapper(func):
            name = func.__name__
            if isinstance(value, str):
                name = value
            if callable(func):
                self.env.globals[name] = func
            return func

        if callable(value):
            return wrapper(value)

        return wrapper
102726
def register(self, bucket, name_or_func, func=None):
        
        assert bucket in self, 'Bucket %s is unknown' % bucket
        if func is None and hasattr(name_or_func, '__name__'):
            name = name_or_func.__name__
            func = name_or_func
        elif func:
            name = name_or_func
        if name in self[bucket]:
            raise AlreadyRegistered('The function %s is already registered' % name)

        self[bucket][name] = func
1145636
def register_service(cls, service):
        
        logger.debug('Registering service {0}'.format(service.name))
        return local_store.instance.register(service)
618129
public final void register() {
        synchronized (lock) {
            if (serviceRegistration == null) {
                BundleClassResolver resolver = new BundleClassResolver();
                serviceRegistration = bundleContext.registerService(SERVICE_NAMES, resolver, serviceProperties);
            }
        }
    }
117913
function registerFunction( $name, $params=null, $result='mixed', $description='' )
    {
        if ( is_string( $params ) )
        {
            if ( $return = parent::registerFunction( $name, null, 'mixed', $description ) )
            {
                $version = ( $result == 2 ) ? 2 : 1;
                $this->wsdl[$name][$version] = $params;
            }
        }
        else
        {
            $return = parent::registerFunction( $name, $params, $result, $description );
        }
        return $return;
    }
752346
def service(self, name: str = None):
        
        if self._services_initialized:
            from warnings import warn
            warn('Services have already been initialized. Please register '
                 f'{name} sooner.')
            return lambda x: x

        def wrapper(service):
            self.register_service(name, service)
            return service
        return wrapper
1097835
protected function registerServices()
    {
        foreach ($this->serviceBindings as $key => $value) {
            is_numeric($key)
                    ? $this->app->singleton($value)
                    : $this->app->singleton($key, $value);
        }
    }
173073
def register_db(cls, dbname):
        """"""
        def decorator(subclass):
            """Register as decorator function."""
            cls._dbs[dbname] = subclass
            subclass.name = dbname
            return subclass
        return decorator
907238
def register_provider(cls, provider):
        """"""
        def decorator(subclass):
            """Register as decorator function."""
            cls._providers[provider] = subclass
            subclass.name = provider
            return subclass
        return decorator
224087
def register_module(self, module, namespace=None):
        
        namespace = namespace if namespace is not None else module \
            if isinstance(module, str) else module.__name__
        self.register_namespace(namespace, module)
268197
def register(self, service, name=''):
        
        # expose a sub-factory
        if isinstance(service, ApiFactory):
            self.services[name] = (service.factory, None)

        # expose a module dynamically as a service
        elif inspect.ismodule(service):
            name = name or service.__name__.split('.')[-1]

            # exclude endpoints with patterns
            for obj in vars(service).values():
                endpoint = getattr(obj, 'endpoint', None)
                if isinstance(endpoint, Endpoint) and endpoint.pattern:
                    route = Route('', endpoint.pattern)
                    self.routes.append((route, endpoint))

            self.services[name] = (ModuleService, service)

        # expose a class dynamically as a service
        elif inspect.isclass(service):
            name = name or service.__name__
            self.services[name] = (ClassService, service)

        # expose an endpoint directly
        elif isinstance(getattr(service, 'endpoint', None), Endpoint):
            if service.endpoint.pattern:
                route = Route('', service.endpoint.pattern)
                self.routes.append((route, service.endpoint))
            else:
                self.services[service.endpoint.name] = (service.endpoint, None)

        # expose a scope
        elif isinstance(service, dict):
            for srv in service.values():
                try:
                    self.register(srv)
                except RuntimeError:
                    pass

        # expose a list of services
        elif isinstance(service, list):
            for srv in service:
                try:
                    self.register(srv)
                except RuntimeError:
                    pass

        # expose a service directly
        else:
            raise RuntimeError('Invalid service provide: {0} ({1}).'.format(service, type(service)))
414171
def register(self, mimetype):
        """"""
        def dec(func):
            self._reg[mimetype] = func
            return func
        return dec