define_service : SERVICE IDENTIFIER OPEN_CURLY_BRACKET settings operation_list CLOSE_CURLY_BRACKET
                   | SERVICE IDENTIFIER OPEN_CURLY_BRACKET operation_list CLOSE_CURLY_BRACKET
519664
def p_define_service(p):
    
    if len(p) == 7:
        body = p[4] + p[5]
    else:
        body = p[4]
    p[0] = DefineService(p[2], body)
149940
def service(self, service):
        
        if service is None:
            raise ValueError("Invalid value for `service`, must not be `None`")
        allowed_values = ["lwm2m", "bootstrap"]
        if service not in allowed_values:
            raise ValueError(
                "Invalid value for `service` ({0}), must be one of {1}"
                .format(service, allowed_values)
            )

        self._service = service
616149
def provider(self, service):
        
        service_provider = default_provider.get_service(str(service.provider.name.name))

        # 1) get the data from the provider service
        module_name = 'th_' + service.provider.name.name.split('Service')[1].lower()
        kwargs = {'trigger_id': str(service.id), 'cache_stack': module_name}
        return getattr(service_provider, 'process_data')(**kwargs)
281336
def service(self):
        """"""
        if not self._service:
            self._service = self._client.service(id=self.service_id)
        return self._service
1079051
def add_service(self, service):
        
        if (self.service is None):
            self.service = service
        elif (isinstance(self.service, dict)):
            self.service = [self.service, service]
        else:
            self.service.append(service)
501260
def load_services(self, services=settings.TH_SERVICES):
        
        kwargs = {}
        for class_path in services:
            module_name, class_name = class_path.rsplit('.', 1)
            klass = import_from_path(class_path)
            service = klass(None, **kwargs)
            self.register(class_name, service)
16675
def introspect_service(self, service_name):
        
        data = {}
        service = self.get_service(service_name)

        for operation in service.operations:
            # These are ``Operation`` objects, not operation strings.
            op_data = self.introspect_operation(operation)
            data[op_data['method_name']] = op_data

        return data
970881
def services(self):
        
        if self._resources is None:
            self.__init()
        if "services" in self._resources:
            url = self._url + "/services"
            return _services.Services(url=url,
                                      securityHandler=self._securityHandler,
                                      proxy_url=self._proxy_url,
                                      proxy_port=self._proxy_port,
                                      initialize=True)
        else:
            return None
120831
protected T serviceUnder(String pathPrefix, Service<I, O> service) {
        return service(CompositeServiceEntry.ofPrefix(pathPrefix, service));
    }
1095395
def list_services(kwargs=None, conn=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_services function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()

    data = conn.list_hosted_services()
    ret = {}
    for item in data.hosted_services:
        ret[item.service_name] = object_to_dict(item)
        ret[item.service_name]['name'] = item.service_name
    return ret
414120
def offload_all_service_containers(self, service):
        
        def anonymous(anonymous_service):
            if not isinstance(anonymous_service, Service):
                raise TypeError("service must be an instance of Service.")

            containers = self.find_service_containers(anonymous_service)
            if containers:
                logger.info("Deleting service: {0} containers.".format(anonymous_service.name))
                for container in six.itervalues(containers):
                    container.delete()

        self._service_map(service, anonymous, descending=True)
1166569
def _init_or_update_registered_service_if_needed(self):
        '''
        
        '''
        if (self.is_service_initialized()):
            old_reg = self._read_service_info(self.args.org_id, self.args.service_id)

            # metadataURI will be in old_reg only for service which was initilized from registry (not from metadata)
            # we do nothing for services which were initilized from metadata
            if ("metadataURI" not in old_reg):
                return

            service_registration = self._get_service_registration()
            # if metadataURI hasn't been changed we do nothing
            if (not self.is_metadataURI_has_changed(service_registration)):
                return
        else:
            service_registration = self._get_service_registration()

        service_metadata     = self._get_service_metadata_from_registry()
        self._init_or_update_service_if_needed(service_metadata, service_registration)
918599
def get_service_id_list() -> List[tuple]:
    """"""
    keys = DB.get_keys('states*')
    services = []
    for key in keys:
        values = key.split(':')
        if len(values) == 4:
            services.append(':'.join(values[1:]))
    return services
932078
def service_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for service in kstone.services.list():
        ret[service.name] = dict((value, getattr(service, value)) for value in dir(service)
                                 if not value.startswith('_') and
                                 isinstance(getattr(service, value), (six.string_types, dict, bool)))
    return ret
85346
async def get_setting(self, service: str, method: str, target: str):
        
        return await self.services[service][method](target=target)
692334
function process(services) {
            if (services == null || (typeof services === "undefined" ? "undefined" : _typeof(services)) !== "object") {
                throw new Error("Service definitions should be an object, a function returning an object (or a !!promise resolving to an object!!)");
            }
            var index = 0;
            var next = Object.keys(services)[index];
            return this.processKey(index, next, services).then(function () {
                return this;
            }.bind(this));
        }
1297731
def register_service(self, name: str, service: Any):
        
        if not isinstance(service, type):
            if hasattr(service, '__class__'):
                _ensure_service_name(service.__class__, name)
            self.services[name] = service
            return

        if self._services_initialized:
            from warnings import warn
            warn('Services have already been initialized. Please register '
                 f'{name} sooner.')
            return

        self._services_registry[_ensure_service_name(service, name)] = service