Keeps track of an exported service

        :param ed_id: ID of the endpoint description
        :param inst: A tuple: (service instance, endpoint description)
433208
def _add_export(self, ed_id, inst):
        # type: (str, Tuple[Any, EndpointDescription]) -> None
        
        with self._exported_instances_lock:
            self._exported_services[ed_id] = inst
1170693
def get_instance_id(self, instance):
        "  "
        if type(instance) in [list, tuple]:
            core_signals.request_finished.connect(receiver=RichTextField.reset_instance_counter_listener)
            if RichTextField.__inst_counter >= len(instance):
                return None
            else:
                obj_id = self.instance[ RichTextField.__inst_counter ].pk
            RichTextField.__inst_counter += 1
        else:
            obj_id = instance.pk
        return obj_id
807625
function(id, deps, factory, _special) {
    define(id, deps, factory, _special || USED_AS_TRANSPORT);
  }
122446
@Override
    public boolean regiserService(NaviRpcExporter exporter) {
        Class<?> interf = exporter.getServiceInterface();
        Object bean = exporter.getServiceBean();
        List<AppIdToken> appIdTokens = getAuthIfPossible(bean);
        String interfSimpleName = interf.getSimpleName();
        try {
            exporters.put(exporter.getName(), exporter);
            if (interf.isAssignableFrom(bean.getClass())) {
                Method[] ms = ReflectionUtil.getAllInstanceMethods(bean.getClass());
                for (Method m : ms) {
                    if (methodResolver.isSupport(m)) {
                        MethodWrapper methodWrapper = new MethodWrapper(interf.getName(),
                                m.getName(), MethodUtil.getArgsTypeName(m));
                        MethodWrapper defaultMethodWrapper = new MethodWrapper(interf.getName(),
                                m.getName(), StringUtil.EMPTY);
                        String key = methodWrapper.toString();
                        MethodDescriptor<String> desc = new MethodDescriptor<String>();
                        desc.setServiceId(key).setMethod(m).setTarget(bean)
                                .setArgumentClass(m.getParameterTypes())
                                .setReturnClass(m.getReturnType()).setInterfClass(interf).setAppIdTokens(appIdTokens);
                        serviceRegistry.addServiceDescriptor(key, desc);
                        serviceRegistry.addServiceDescriptor(defaultMethodWrapper.toString(), desc);
                        if (LOG.isDebugEnabled()) {
                            LOG.debug(String.format(
                                    "Register service key=[%s], %s %s#%s(%s) successfully", key, m
                                            .getReturnType().getSimpleName(), interf.getName(), m
                                            .getName(), StringUtil.toString4Array(m
                                            .getParameterTypes())));
                        }
                    }
                }
                LOG.info("Find rpc service configured, interface is "
                        + interfSimpleName + " , implementation is "
                        + AopUtils.getTargetClass(bean).getName());
                return true;
            } else {
                LOG.error("The interface " + interfSimpleName + " is not compatible with the bean "
                        + bean.getClass().getName());
            }
        } catch (Exception e) {
            LOG.error(
                    "The interface " + interfSimpleName + " is configured wrongly."
                            + e.getMessage(), e);
        }
        return false;
    }
700856
private Optional<DurationThresholdTracker> requestDurationThresholdTracker(MetricId id,
                                                                             String endpoint) {
    return durationThresholdConfig.getDurationThresholdForEndpoint(endpoint)
        .map(threshold -> Optional.of(new DurationThresholdTracker(id, metricRegistry, threshold)))
        .orElse(Optional.empty());
  }
943901
def service_per_endpoint(self, context=None):
        
        endps = self.getattr("endpoints", context)
        res = {}
        for service, specs in endps.items():
            for endp, binding in specs:
                res[endp] = (service, binding)
        return res
380947
private Long fetchServiceId(ServiceReference serviceReference) {
        return (Long) serviceReference.getProperty(org.osgi.framework.Constants.SERVICE_ID);
    }
1077524
def _record_extension(self, objective_id, key, value):
        
        record_bean = {
            'value': value,
            'displayName': self._text_bean(key),
            'description': self._text_bean(key),
            'displayLabel': self._text_bean(key),
            'associatedId': str(objective_id)
        }
        return record_bean
248288
def fetch(cls, id, service=None, endpoint=None, *args, **kwargs):
        """"""
        if service is None and endpoint is None:
            raise InvalidArguments(service, endpoint)

        if endpoint is None:
            sid = service['id'] if isinstance(service, Entity) else service
            endpoint = 'services/{0}/integrations'.format(sid)

        return getattr(Entity, 'fetch').__func__(cls, id, endpoint=endpoint,
                                                 *args, **kwargs)
98522
def display_with_id(self, obj, display_id, update=False):
        """"""
        ip = get_ipython()
        if hasattr(ip, "kernel"):
            data, md = ip.display_formatter.format(obj)
            content = {
                'data': data,
                'metadata': md,
                'transient': {'display_id': display_id},
            }
            msg_type = 'update_display_data' if update else 'display_data'
            ip.kernel.session.send(ip.kernel.iopub_socket, msg_type, content, parent=ip.parent_header)
        else:
            display(obj)
748012
def owns_endpoint(self, endpoint):
        

        if self.blueprint:
            if endpoint.startswith(self.blueprint.name):
                endpoint = endpoint.split(self.blueprint.name + '.', 1)[-1]
            else:
                return False
        return endpoint in self.endpoints
774889
private EndpointActivationServiceInfo createEndpointActivationServiceInfo(String id) {
        EndpointActivationServiceInfo easInfo = endpointActivationServices.get(id);
        if (easInfo == null) {
            easInfo = new EndpointActivationServiceInfo(id);
            endpointActivationServices.put(id, easInfo);
        }
        return easInfo;
    }
179147
def _get_service_port(self, instance):
        
        host = instance.get('host', DEFAULT_HOST)
        port = instance.get('port', DEFAULT_PORT)
        # default port is the name of the service but lookup would fail
        # if the /etc/services file is missing. In that case, fallback to numeric
        try:
            socket.getaddrinfo(host, port)
        except socket.gaierror:
            port = DEFAULT_PORT_NUM

        return port
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
295009
def getServiceDependenciesUIDs(self):
        
        deps = self.getServiceDependencies()
        deps_uids = [service.UID() for service in deps]
        return deps_uids
1283366
def find_service_by_id(self, service_id):
        
        service_id_key = 'serviceDefinitionId'
        service_id = str(service_id)
        for service in self._services:
            if service_id_key in service.values and str(
                    service.values[service_id_key]) == service_id:
                return service

        try:
            # If service_id is int or can be converted to int then we couldn't find it
            int(service_id)
            return None
        except ValueError:
            pass

        # try to find by type
        return self.find_service_by_type(service_id)
1266329
def assign_operation_ids(spec, operids):
    

    empty_dict = {}

    for path_name, path_data in six.iteritems(spec['paths']):
        for method, method_data in six.iteritems(path_data):
            oper_id = operids.get(path_name, empty_dict).get(method)
            if oper_id:
                method_data['operationId'] = oper_id