:param service_name:
        possible "sws", "pws", "book", "hfs", etc.
    :param implementation_name:
        possible values: "file", etc.
425986
def get_mockdata_url(service_name, implementation_name,
                     url, headers):
    

    RESOURCE_ROOT = _mockdata_path_root(service_name, implementation_name)
    file_path = None
    success = False
    start_time = time.time()

    mockdata_delay = getattr(settings, "RESTCLIENTS_MOCKDATA_DELAY", 0.0)
    time.sleep(mockdata_delay)

    for resource_dir in app_resource_dirs:
        logger.debug("Check url %s, service_name: %s, in resource_dir: %s" %
                     (url, service_name, resource_dir))

        response = _load_resource_from_path(resource_dir, service_name,
                                            implementation_name, url, headers)

        if response:
            request_time = time.time() - start_time
            rest_request.send(sender='restclients',
                              url=url,
                              request_time=request_time,
                              hostname=socket.gethostname(),
                              service_name=service_name)
            rest_request_passfail.send(sender='restclients',
                                       url=url,
                                       success=True,
                                       hostname=socket.gethostname(),
                                       service_name=service_name)
            return response

    # If no response has been found in any installed app, return a 404
    logger.info("404 for url %s, path: %s" %
                (url, "resources/%s/%s/%s" %
                 (service_name,
                  implementation_name,
                  convert_to_platform_safe(url))))
    rest_request_passfail.send(sender='restclients',
                               url=url,
                               success=False,
                               hostname=socket.gethostname(),
                               service_name=service_name)
    response = MockHTTP()
    response.status = 404
    response.reason = "Not Found"
    return response
465997
def resolve_service_spec(self, name, lineno):
        """"""

        if name in self.service_specs:
            return self.service_specs[name].link(self)

        if '.' in name:
            include_name, component = name.split('.', 2)
            if include_name in self.included_scopes:
                return self.included_scopes[
                    include_name
                ].resolve_service_spec(component, lineno)

        raise ThriftCompilerError(
            'Unknown service "%s" referenced at line %d%s' % (
                name, lineno, self.__in_path()
            )
        )
767475
def _name_helper(name: str):
    
    name = name.rstrip()
    if name.endswith(('.service', '.socket', '.target')):
        return name
    return name + '.service'
1095371
def get_sdc_by_name(self, name):
        
        for sdc in self.sdc:
            if sdc.name == name:
                return sdc
        raise KeyError("SDC of that name not found")
122872
def get_service_name(wrapped, instance, args, kwargs):
    """"""
    if 'serviceAbbreviation' not in instance._service_model.metadata:
        return instance._service_model.metadata['endpointPrefix']
    return instance._service_model.metadata['serviceAbbreviation']
596472
def set_service(self, name, service_config, project=False):
        
        if not self.project_config.services or name not in self.project_config.services:
            self._raise_service_not_valid(name)
        self._validate_service(name, service_config)
        self._set_service(name, service_config, project)
        self._load_services()
740179
def service(name, action):
    
    if action == 'open':
        subprocess.check_output(['ufw', 'allow', str(name)],
                                universal_newlines=True)
    elif action == 'close':
        subprocess.check_output(['ufw', 'delete', 'allow', str(name)],
                                universal_newlines=True)
    else:
        raise UFWError(("'{}' not supported, use 'allow' "
                        "or 'delete'").format(action))
1346394
def _iter_service_names():
    '''
    
    '''
    found = set()
    for line in glob.glob('/etc/init.d/*'):
        name = os.path.basename(line)
        found.add(name)
        yield name

    # This walk method supports nested services as per the init man page
    # definition 'For example a configuration file /etc/init/rc-sysinit.conf
    # is named rc-sysinit, while a configuration file /etc/init/net/apache.conf
    # is named net/apache'
    init_root = '/etc/init/'
    for root, dirnames, filenames in salt.utils.path.os_walk(init_root):
        relpath = os.path.relpath(root, init_root)
        for filename in fnmatch.filter(filenames, '*.conf'):
            if relpath == '.':
                # service is defined in the root, no need to append prefix.
                name = filename[:-5]
            else:
                # service is nested, append its relative path prefix.
                name = os.path.join(relpath, filename[:-5])
            if name in found:
                continue
            yield name
390097
def GetServices(self,filename):
        """"""
        objlist=[]
        for sobj in self.services:
            if sobj.KnowsFile(filename) :
                objlist.append(sobj)

        if len(objlist)==0:
            return None

        return objlist
270175
def get_service_keys(self, service_name):
        
        keys = []
        for key in self._get_service_keys(service_name)['resources']:
            keys.append(key['entity']['name'])

        return keys
935511
def make_serviceitem_name(name, condition='is', negate=False, preserve_case=False):
    
    document = 'ServiceItem'
    search = 'ServiceItem/name'
    content_type = 'string'
    content = name
    ii_node = ioc_api.make_indicatoritem_node(condition, document, search, content_type, content,
                                              negate=negate, preserve_case=preserve_case)
    return ii_node
292087
def update_name(service_id, snapshot_id, name)
      return unless service_id && snapshot_id && name
      verify_input_name(name)

      key = self.class.redis_key(service_id)
      # NOTE: idealy should watch on combination of (service_id, snapshot_id)
      # but current design doesn't support such fine-grained watching.
      client.watch(key)

      snapshot = client.hget(redis_key(service_id), snapshot_id)
      return nil unless snapshot
      snapshot = Yajl::Parser.parse(snapshot)
      snapshot["name"] = name

      res = client.multi do
        save_snapshot(service_id, snapshot)
      end

      unless res
        raise ServiceError.new(ServiceError::REDIS_CONCURRENT_UPDATE)
      end
      true
    end
697103
def connection_service_name(service, *args):
    '''  '''
    # if the service is a string
    if isinstance(service, str):
        return service

    return normalize_string(type(service).__name__)
612200
def get_service(self, name):
        
        self._convert_connected_app()
        if not self.project_config.services or name not in self.project_config.services:
            self._raise_service_not_valid(name)
        if name not in self.services:
            self._raise_service_not_configured(name)

        return self._get_service(name)
1301322
def getClientModuleName(self):
        
        name = GetModuleBaseNameFromWSDL(self._wsdl)
        if not name:
            raise WsdlGeneratorError, 'could not determine a service name'
        
        if self.client_module_suffix is None:
            return name

        return '%s%s' %(name, self.client_module_suffix)
88473
function (methodName) {
            var parameters = this.smd.parameters || [];

            parameters = parameters.concat(this.smd.services[methodName].parameters || []);

            return parameters;
        }
1331946
def service_name(doc):
    """"""
    for service_id, service in doc.get('services', {}).items():
        service['id'] = service_id
        service['organisation_id'] = doc['_id']

        name = service.get('name', None)
        if name:
            yield name, service