get or register a service
339419
function getOrRegister(name, definition) {
    if(name && !definition) {
      return registry.get(name);
    }
    if(name && definition) {
      return registry.register(name, definition);
    }

    return null;
  }
1367761
protected function registerService()
	{
	    $this->app->singleton($this->getProviderKey(), function($app)
	    {
	    	return new Service($this->getProviderKey(), null, $this->getAggregateService());
	    });
	}
877303
def get_service(self, name, search_filter):
        """"""
        if self.version == 1:
            service_filter = "service.{name}".format(name=name)
            return jmespath.search(service_filter, self.get(search_filter))
        else:
            service_filter = "services[?name=='{}']".format(name)
            return one(jmespath.search(service_filter, self.get(search_filter)))
283425
def register_subservice(self, uri, service):
        
        found = False

        self.create_route(uri, True)
        self.routes[uri]['handlers'].set_subservice(service)
1326504
protected function registering()
    {
        $this->app->bindShared(ServiceShortCuts::RESOLVER_SERVICE, function () {
            return new Resolver($this->app);
        });

        $this->app->bindShared(ServiceShortCuts::GHOST_SERVICE, function () {
            return new GhostServices($this->app);
        });

        $this->app->bind(ServiceShortCuts::CORE_INITIALIZED, true);

        $this->app->booting(function () {
            $loader = AliasLoader::getInstance();

            foreach ($this->aliases as $facade => $facadeClass) {
                $loader->alias($facade, $facadeClass);
            }
        });
    }
406648
def get(self, service, path, **kwargs):
        
        return self.make_request(Methods.GET, service, path, **kwargs)
1121111
protected function registerService()
	{
	    $this->app->singleton($this->getProviderKey(), function($app)
	    {
	    	return new Service($this->getProviderKey(), new DataSource(new Model()));
	    });
	}
281336
def service(self):
        """"""
        if not self._service:
            self._service = self._client.service(id=self.service_id)
        return self._service
1127345
public function register($name, $service, $args = [], $isParam = false)
    {
        if (!$isParam && !$this->hasService($name)) {
            $this->registeredList['services'][$name] = [
                'class' => $service,
                'arguments' => $args,
            ];

            return true;
        } elseif ($isParam && !$this->hasParam($name)) {
            $this->registeredList['params'][$name] = $service;

            return true;
        }

        return false;
    }
364789
def _get_from_prototype(self, factory, svc_registration):
        # type: (Any, ServiceRegistration) -> Any
        
        svc_ref = svc_registration.get_reference()
        service = factory.get_service(self.__bundle, svc_registration)

        try:
            # Check if the service already exists
            services, counter = self.__factored[svc_ref]
            services.append(service)
            counter.inc()
        except KeyError:
            counter = _UsageCounter()
            counter.inc()

            # Store the counter
            self.__factored[svc_ref] = ([service], counter)

        return service
1145636
def register_service(cls, service):
        
        logger.debug('Registering service {0}'.format(service.name))
        return local_store.instance.register(service)
270936
protected function registerService()
    {
        $this->app->singleton('pragmarx.version', function () {
            $version = new Version($this->config);

            $version->setConfigFileStub($this->getConfigFileStub());

            return $version;
        });
    }
375385
def service_get(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.get_service(**kwargs)
663391
def services(cls):
        """"""
        return cls.json_get('%s/services' % cls.api_url, empty_key=True,
                            send_key=False)
1083950
def get_service(self, name):
    
    return services.get_service(self._get_resource_root(), name, self.name)
507231
def get_config(self, service, setting):
        
        try:
            return self.get_service(service)[setting]
        except KeyError:
            return getattr(self, setting + '_DEFAULT')
709624
protected ServiceRegistration registerProxy(Object objectProxy, Class clazz) {
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        ServiceRegistration registration;
        registration = context.registerService(clazz, objectProxy, props);

        return registration;
    }