Get service for a given service type.

        :param service_type: Service type, ServiceType
        :return: Service
17579
def find_service_by_type(self, service_type):
        
        for service in self._services:
            if service_type == service.type:
                return service
        return None
281336
def service(self):
        """"""
        if not self._service:
            self._service = self._client.service(id=self.service_id)
        return self._service
73896
def wants(cls, *service_names):
        """"""
        def _decorator(cls_):                                # pylint: disable=missing-docstring
            for service_name in service_names:
                cls_._services_requested[service_name] = "want"  # pylint: disable=protected-access
            return cls_
        return _decorator
1359553
def services_type(loader):
    

    def impl(string):
        t_services = loader.get_models('common.models#Services')
        if set(string) - set("bqtf"):
            raise ValueError
        return t_services(_str=''.join(set(string)))

    return impl
373991
def has_service_of_type(self, service_type):
        
        summary = self.get_space_summary()
        for instance in summary['services']:
            if 'service_plan' in instance:
                if service_type == instance['service_plan']['service']['label']:
                    return True

        return False
718669
def get_services(profile='pagerduty', subdomain=None, api_key=None):
    '''
    
    '''

    return _list_items(
        'services',
        'id',
        profile=profile,
        subdomain=subdomain,
        api_key=api_key,
    )
107602
def get_service_definitions(self, service_type=None):
        
        route_values = {}
        if service_type is not None:
            route_values['serviceType'] = self._serialize.url('service_type', service_type, 'str')
        response = self._send(http_method='GET',
                              location_id='d810a47d-f4f4-4a62-a03f-fa1860585c4c',
                              version='5.0-preview.1',
                              route_values=route_values)
        return self._deserialize('[ServiceDefinition]', self._unwrap_collection(response))
649566
def _get_services(self, full_objects=False):
        
        bsc = api.get_tool("bika_setup_catalog")
        brains = bsc(portal_type="AnalysisService")
        if full_objects:
            return map(api.get_object, brains)
        return brains
1201325
public Builder getRequest(final RequestTypeEnum requestType, final RestOperationTypeEnum restOperation) {
		return getRequest(requestType, restOperation, null);
	}
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)
957877
def _http_request(self, service_type, **kwargs):
        
        request_params = urlencode(kwargs)
        request_params = request_params.replace('%28', '').replace('%29', '')

        uri = '%s%s?api_key=%s&%s' % \
            (self.base_url, service_type, self.api_key, request_params)
        header, response = self.conn.request(uri, method='GET')
        return header, response
140881
def services(self, *args, **kwargs):
        
        return self._client.services(*args, scope=self.id, **kwargs)
348945
def get_service_details(self, service_id: str) -> dict:
        
        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Only the Swarm manager node can retrieve all'
                               ' the services details.')

        service = self._client.services.get(service_id)
        return service.attrs
1283563
@Deprecated
    public List<Service> getServices(String type, List<String> algorithms) {
        List<ServiceId> ids = new ArrayList<>();
        for (String alg : algorithms) {
            ids.add(new ServiceId(type, alg));
        }
        return getServices(ids);
    }
663391
def services(cls):
        """"""
        return cls.json_get('%s/services' % cls.api_url, empty_key=True,
                            send_key=False)
845801
def get_google_service(service_type=None,version=None):
    '''
    
    '''
    if service_type == None:
        service_type = "storage"
    if version == None:
        version = "v1"

    credentials = GoogleCredentials.get_application_default()
    return build(service_type, version, credentials=credentials)
286160
def request_service(self, type, id=0):
        
        srvs = self.services_by_name.get(type)
        if not srvs:
            return

        ser = srvs[id]

        if not ser.system:
            ser.setup_system(self, id=id)
        return ser