Create a client with the given user agent that will query the Mingle end point URL at `mingle`. The `conduit` and `colleague` arguments are string formats used to create the URLs to query the conduit and colleague respectively.
546041
function Colleagues (options) {
    this._ua = options.ua
    this._mingle = options.mingle
    this._conduit = options.conduit
    this._colleague = options.colleague
}
1167149
def create_request_url(self, profile_type, steamID):
        """"""
        regex = re.compile('^\d{17,}$')
        if regex.match(steamID):
            if profile_type == self.USER:
                url = "http://steamcommunity.com/profiles/%s/?xml=1" % (steamID)
            if profile_type == self.GROUP:
                url = "http://steamcommunity.com/gid/%s/memberslistxml/?xml=1" % (steamID)
        else:
            if profile_type == self.USER:
                url = "http://steamcommunity.com/id/%s/?xml=1" % (steamID)
            if profile_type == self.GROUP:
                url = "http://steamcommunity.com/groups/%s/memberslistxml/?xml=1" % (steamID)
        return url
45813
function Client(endpointUrl, sourceId) {
		this.restClient = new restClient.Client();

		this.endpointUrl = endpointUrl;

		if (this.endpointUrl) {
			// Remove the trailing slash if necessary
			if (this.endpointUrl.indexOf('/', this.endpointUrl.length - 1) !== -1) {
				this.endpointUrl = this.endpointUrl.substr(0, this.endpointUrl.length - 2);
			}

			// Add the default version if not present
			// TODO: The client should take care of the version in a better way
			if (this.endpointUrl.indexOf('/v1', this.endpointUrl.length - 3) === -1) {
				this.endpointUrl = this.endpointUrl + '/v1';
			}
		}

		if (sourceId !== undefined) {
			this.sourceId = sourceId;
		}
	}
1013184
function $createClient(options) {
        /*
         * Ensure we have default options.
         */
        options = extend({}, {}, options);

        const { url, transport } = options;

        if (_clients[url]) {
            return _clients[url];
        }

        const client = mqtt.connect(url, transport);

        _clients[url] = client;

        return client;
    }
218179
def add_member(self, urls):
        
        member_add_request = etcdrpc.MemberAddRequest(peerURLs=urls)

        member_add_response = self.clusterstub.MemberAdd(
            member_add_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )

        member = member_add_response.member
        return etcd3.members.Member(member.ID,
                                    member.name,
                                    member.peerURLs,
                                    member.clientURLs,
                                    etcd_client=self)
691739
def query_multiple_endpoints(urls, query: PyQuery):
    
    urls = list(urls)
    return _query_multiple_endpoints(urls, query)
1167755
function Client(arg, port) {
  if (this instanceof Client === false) {
    return new Client(arg, port);
  }

  if (arg === undefined) {
    throw new TypeError('arg should be a host address, name or universe');
  }

  this.host = Number.isInteger(arg) ? e131.getMulticastGroup(arg) : arg;
  this.port = port || e131.DEFAULT_PORT;
  this._socket = dgram.createSocket('udp4');
}
154939
def createNetwork(self, data, headers=None, query_params=None, content_type="application/json"):
        
        uri = self.client.base_url + "/network"
        return self.client.post(uri, data, headers, query_params, content_type)
700988
function(validBidRequests) {
    // Do we need to group by bidder? i.e. to make multiple requests for
    // different endpoints.

    let ret = {
      method: 'POST',
      url: '',
      data: '',
      bidRequest: []
    };

    if (validBidRequests.length < 1) {
      return ret;
    }

    let ENDPOINT_URL;

    // These variables are used in creating the user sync URL.
    siteId = validBidRequests[0].params.siteId;
    bidder = validBidRequests[0].bidder;

    const data = Object.assign({
      placements: [],
      time: Date.now(),
      user: {},
      url: utils.getTopWindowUrl(),
      referrer: document.referrer,
      enableBotFiltering: true,
      includePricingData: true,
      parallel: true
    }, validBidRequests[0].params);

    validBidRequests.map(bid => {
      let config = CONFIG[bid.bidder];
      ENDPOINT_URL = config.BASE_URI;

      const placement = Object.assign({
        divName: bid.bidId,
        adTypes: bid.adTypes || getSize(bid.sizes)
      }, bid.params);

      if (placement.networkId && placement.siteId) {
        data.placements.push(placement);
      }
    });

    ret.data = JSON.stringify(data);
    ret.bidRequest = validBidRequests;
    ret.url = ENDPOINT_URL;

    return ret;
  }
73826
function createUrlFromEndpointAndOptions (endpoint, options) {
  const query = qs.stringify(options);
  const baseURL = `${host}${endpoint}`;
  return query ? `${baseURL}?${query}` : baseURL;
}
887740
def build_url(self, path, params=None):
        '''
        
        '''
        url = u'%s/%s/productCode/%s' % (
            self.endpoint,
            path,
            self.product_code,
        )
        if params:
            for key, value in params.items():
                url = u'%s/%s/%s' % (url, key, value)

        return url
225772
def _make_request(self, url, params=None, opener=None):
        
        # Create the request object
        args = [i for i in [url, params] if i]
        request = urllib.request.Request(*args)
        # If the client has credentials, include them as a header
        if self.username and self.password:
            credentials = '%s:%s' % (self.username, self.password)
            encoded_credentials = base64.encodestring(
                credentials.encode("utf-8")
            ).decode("utf-8").replace("\n", "")
            header = 'Basic %s' % encoded_credentials
            request.add_header('Authorization', header)
        # If the request provides a custom opener, like the upload request,
        # which relies on a multipart request, it is applied here.
        if opener:
            opener = urllib.request.build_opener(opener)
            request_method = opener.open
        else:
            request_method = urllib.request.urlopen
        # Make the request
        try:
            response = request_method(request)
        except Exception:
            e = sys.exc_info()[1]
            if getattr(e, 'code', None) == 404:
                raise DoesNotExistError("The resource you've requested does \
not exist or is unavailable without the proper credentials.")
            elif getattr(e, 'code', None) == 401:
                raise CredentialsFailedError("The resource you've requested \
requires proper credentials.")
            else:
                raise e
        # Read the response and return it
        return response.read()
53799
def _add_client(self, url, key=None, secret=None):
        

        if "://" in url:
            server, endpoint = self._deconstruct_url(url)
        else:
            server = url

        if server not in self._server_cache:
            if not (key and secret):
                client = Client(
                    webfinger=self.client.webfinger,
                    name=self.client.name,
                    type=self.client.type,
                )
                client.set_pump(self)
                client.register(server)
            else:
                client = Client(
                    webfinger=self.client.webfinger,
                    key=key,
                    secret=secret,
                    type=self.client.type,
                    name=self.client.name,
                )
                client.set_pump(self)

            self._server_cache[server] = client
1149582
function taskQueuesUrl(workspaceSid, taskQueueSid) {
  return _.join(
    _.filter([workspacesUrl(workspaceSid), 'TaskQueues', taskQueueSid], _.isString),
    '/'
  );
}
576848
async def main():
    
    # Create Client from endpoint string in Duniter format
    client = Client(ES_CORE_ENDPOINT)

    # Get the current node (direct REST GET request)
    print("\nGET g1-test/block/current/_source:")
    response = await client.get('g1-test/block/current/_source')
    print(response)

    # Get the node number 2 with only selected fields (direct REST GET request)
    print("\nGET g1-test/block/2/_source:")
    response = await client.get('g1-test/block/2/_source', {'_source': 'number,hash,dividend,membersCount'})
    print(response)

    # Close client aiohttp session
    await client.close()

    # Create Client from endpoint string in Duniter format
    client = Client(ES_USER_ENDPOINT)

    # prompt entry
    pubkey = input("\nEnter a public key to get the user profile: ")

    # Get the profil of a public key (direct REST GET request)
    print("\nGET user/profile/{0}/_source:".format(pubkey))
    response = await client.get('user/profile/{0}/_source'.format(pubkey.strip(' \n')))
    print(response)

    # Close client aiohttp session
    await client.close()
142676
function makerequest(method, url, data, cb) {
    var rq = superagent(method, url);

    rq.set('User-Agent', self.agent);
    rq.set('Accept', self.version + '+json'); // always use json

    if (self.timeout)  { rq.timeout(self.timeout); }
    if (self.username) { rq.auth(self.username, self.password); }
    if (data) { rq.send(data); }

    rq.end(function(err, resp) {
      err = (resp && resp.error) || err;
      debug(method + ' ' + url + ' ' + (err || '') + '(X-RateLimit-Remaining: ' + resp.header['x-ratelimit-remaining'] + ')');
      if (err) return cb(err);
      return cb(null, resp.body);
    });
  }
27067
def create_client(self, config_path):
        
        config = ProjectConfig(config_path)
        editor = Editor(self._vim)
        launcher = EnsimeLauncher(self._vim, config)

        if self.using_server_v2:
            client = EnsimeClientV2(editor, launcher)
        else:
            client = EnsimeClientV1(editor, launcher)

        self._create_ticker()

        return client