Construct a service for the endpoint as described.
775575
def _makeService(self):
        
        if self._endpointService is None:
            _service = service
        else:
            _service = self._endpointService
        return _service(
            self.description.encode('ascii'), self.factory.getFactory())
268197
def register(self, service, name=''):
        
        # expose a sub-factory
        if isinstance(service, ApiFactory):
            self.services[name] = (service.factory, None)

        # expose a module dynamically as a service
        elif inspect.ismodule(service):
            name = name or service.__name__.split('.')[-1]

            # exclude endpoints with patterns
            for obj in vars(service).values():
                endpoint = getattr(obj, 'endpoint', None)
                if isinstance(endpoint, Endpoint) and endpoint.pattern:
                    route = Route('', endpoint.pattern)
                    self.routes.append((route, endpoint))

            self.services[name] = (ModuleService, service)

        # expose a class dynamically as a service
        elif inspect.isclass(service):
            name = name or service.__name__
            self.services[name] = (ClassService, service)

        # expose an endpoint directly
        elif isinstance(getattr(service, 'endpoint', None), Endpoint):
            if service.endpoint.pattern:
                route = Route('', service.endpoint.pattern)
                self.routes.append((route, service.endpoint))
            else:
                self.services[service.endpoint.name] = (service.endpoint, None)

        # expose a scope
        elif isinstance(service, dict):
            for srv in service.values():
                try:
                    self.register(srv)
                except RuntimeError:
                    pass

        # expose a list of services
        elif isinstance(service, list):
            for srv in service:
                try:
                    self.register(srv)
                except RuntimeError:
                    pass

        # expose a service directly
        else:
            raise RuntimeError('Invalid service provide: {0} ({1}).'.format(service, type(service)))
1021799
def get(self, endpoint, **kwargs):
        
        return self._request(requests.get, endpoint, **kwargs)
1277731
def _attach_endpoints(self):
        """"""
        for name, endpoint in inspect.getmembers(self):
            if inspect.isclass(endpoint) and issubclass(endpoint, self._Endpoint) and (endpoint is not self._Endpoint):
                endpoint_instance = endpoint(self.base_requester)
                setattr(self, endpoint_instance.endpoint, endpoint_instance)
476977
def _attach_endpoints(self):
        """"""
        for name, value in inspect.getmembers(self):
            if inspect.isclass(value) and issubclass(value, self._Endpoint) and (value is not self._Endpoint):
                endpoint_instance = value(self.requester)
                setattr(self, endpoint_instance.endpoint_base, endpoint_instance)
                if not hasattr(endpoint_instance, 'get_endpoints'):
                    endpoint_instance.get_endpoints = ()
                if not hasattr(endpoint_instance, 'post_endpoints'):
                    endpoint_instance.post_endpoints = ()
                if not hasattr(endpoint_instance, 'is_callable'):
                    endpoint_instance.is_callable = False
                for endpoint in (endpoint_instance.get_endpoints + endpoint_instance.post_endpoints):
                    function = endpoint_instance.create_endpoint_function(endpoint)
                    function_name = endpoint.replace('/', '_')
                    setattr(endpoint_instance, function_name, function)
                    function.__name__ = str(function_name)
                    function.__doc__ = 'Tells the object to make a request to the {0} endpoint'.format(endpoint)
817814
function Endpoint(url) {
  if (!(this instanceof Endpoint)) return new Endpoint(url);

  var p;
  if (typeof url === 'string') {
    //parse url
    var rr = REGEXP_URL.exec(url);
    if (rr) {
      p = {
        protocol: rr[1],
        username: rr[2],
        password: rr[3],
        host: rr[4],
        port: rr[5],
        path: rr[6],
        url: rr[0]
      };
    }
  } else if (typeof url === 'object') {
    p = url;
  }
  p || (p = {});

  this.protocol = (p.protocol && p.protocol.toLowerCase()) || PROTOCOL.TCP;
  p.username && (this.username = p.username);
  p.password && (this.password = p.password);
  this.host = p.host || 'localhost';
  this.port = p.port || defaultPort(this.protocol);
  p.path && (this.path = p.path);
  p.url && (this.url = p.url);
}
154759
public <I extends Request, O extends Response> Function<Service<I, O>, LoggingService<I, O>>
    newDecorator() {
        return this::build;
    }
1243489
def _build_and_attach_node(endpoint_class, method_name=nil)
      # Create the new endpoint
      endpoint_instance = endpoint_class.new(@requester, method_name, self)
      # Attach the endpoint as an instance variable and method
      method_name ||= endpoint_class.name.demodulize.underscore
      self.instance_variable_set("@#{method_name}", endpoint_instance)
      self.define_singleton_method(method_name.to_s) { endpoint_instance }
      endpoint_instance
    end
1326015
private void ensureMinimum() {
        int belowMin = minEndpoints - endpoints.size();
        if (belowMin > 0) {
            LOGGER.debug(logIdent(hostname, this) + "Service is {} below minimum, filling up.", belowMin);

            synchronized (epMutex) {
                for (int i = 0; i < belowMin; i++) {
                    Endpoint endpoint = endpointFactory.create(hostname, bucket, username, password, port, ctx);
                    endpoints.add(endpoint);
                    endpointStates.register(endpoint, endpoint);
                    endpoint.connect().subscribe(new Subscriber<LifecycleState>() {
                        @Override
                        public void onCompleted() { /* ignored on purpose */ }

                        @Override
                        public void onError(Throwable e) {
                            LOGGER.warn(logIdent(hostname, PooledService.this)
                                + "Got an error while connecting endpoint!", e);
                        }

                        @Override
                        public void onNext(LifecycleState state) { /* ignored on purpose */ }
                    });
                }

                LOGGER.debug(logIdent(hostname, PooledService.this)
                        + "New number of endpoints is {}", endpoints.size());
            }
        }
    }
846595
def put(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('put', endpoint, data=json, params=params)
729740
def endpoint(url):
    """"""
    if not url:
        click.secho(dtool_config.utils.get_ecs_endpoint(CONFIG_PATH))
    else:
        click.secho(dtool_config.utils.set_ecs_endpoint(CONFIG_PATH, url))
485264
def create_service(self, customer_id, name, publish_key=None, comment=None):
		""""""
		body = self._formdata({
			"customer_id": customer_id,
			"name": name,
			"publish_key": publish_key,
			"comment": comment,
		}, FastlyService.FIELDS)
		content = self._fetch("/service", method="POST", body=body)
		return FastlyService(self, content)
514559
function Endpoint(log, role, settings, filters) {
  Duplex.call(this);

  // * Initializing logging infrastructure
  this._log = log.child({ component: 'endpoint', e: this });

  // * First part of the handshake process: sending and receiving the client connection header
  //   prelude.
  assert((role === 'CLIENT') || role === 'SERVER');
  if (role === 'CLIENT') {
    this._writePrelude();
  } else {
    this._readPrelude();
  }

  // * Initialization of component. This includes the second part of the handshake process:
  //   sending the first SETTINGS frame. This is done by the connection class right after
  //   initialization.
  this._initializeDataFlow(role, settings, filters || {});

  // * Initialization of management code.
  this._initializeManagement();

  // * Initializing error handling.
  this._initializeErrorHandling();
}
1210450
private Retrofit.Builder setEndpoint(Retrofit.Builder retrofitBuilder, String endpoint) {
    if (endpoint != null) {
      return retrofitBuilder.baseUrl(endpoint);
    }
    return retrofitBuilder;
  }
635663
public EndpointInfo build() {
        checkState(availableMimeTypes != null && !availableMimeTypes.isEmpty(),
                   "Should at least have an available media type.");
        return new EndpointInfo(hostnamePattern, pathMapping, regexPathPrefix,
                                fragment, defaultMimeType, availableMimeTypes);
    }
613098
function createEndpointFromObject(path, query, body) {
  // OPTIONS gives server permission to use CORS
  server.createRoute({
    request: {
        url: path,
        query: query || {},
        method: 'options',
    },
    response: {
        code: 200,
        delay: config.latency,
        body: {},
        headers: {
          'Access-Control-Allow-Origin': config.allowOrigin,
          // allow several methods since some endpoints are writable
          'Access-Control-Allow-Methods': 'GET, PUT, POST',
          'Access-Control-Allow-Credentials': 'true'
        }
    }
  });
  return server.get(path)
               .query(query)
               .responseHeaders({
                 'Access-Control-Allow-Origin': config.allowOrigin,
                 'Access-Control-Allow-Methods': 'GET, PUT, POST',
                 'Access-Control-Allow-Credentials': 'true'
               })
               .body(body)
               .delay(config.latency);
}
397988
def put(self, endpoint: str, **kwargs) -> dict:
        """"""

        return self._request('PUT', endpoint, **kwargs)