Return an instance of Client.
332342
def get_instance():
    """"""
    global _instances
    user_agents = _config['user-agents']

    user_agent = user_agents[
        random.randint(0, len(user_agents) - 1)
    ] if len(user_agents) > 0 else DEFAULT_UA

    instance_key = user_agent

    try:
        instance = _instances[instance_key]
    except KeyError:
        instance = Client(user_agent, get_proxy)
        _instances[instance_key] = instance

    return instance
1212673
def getInstance(cls, *args):
        '''
        
        '''
        if not cls.__singleton:
            cls.__singleton = Config(*args)
        return cls.__singleton
1328178
def client(self):
        
        if self._client is None:
            self._client = self._get_client()
        return self._client
116462
def get_client(url, username, password, allow_insecure, ca_bundle):
    """"""
    return _HNVClient(url, username, password, allow_insecure, ca_bundle)
838779
def client_get(self, url, **kwargs):
        """"""
        response = requests.get(self.make_url(url), headers=self.headers)
        if not response.ok:
            raise Exception(
                '{status}: {reason}.\nCircleCI Status NOT OK'.format(
                    status=response.status_code, reason=response.reason))
        return response.json()
750222
def get_instance(self, payload):
        
        return CallInstance(self._version, payload, account_sid=self._solution['account_sid'], )
720199
def _get_client():
    '''
    
    '''
    client = salt.cloud.CloudClient(
            os.path.join(os.path.dirname(__opts__['conf_file']), 'cloud')
            )
    return client
956389
def get_client():
    """"""
    return InfluxDBClient(
        settings.INFLUXDB_HOST,
        settings.INFLUXDB_PORT,
        settings.INFLUXDB_USER,
        settings.INFLUXDB_PASSWORD,
        settings.INFLUXDB_DATABASE,
        timeout=settings.INFLUXDB_TIMEOUT,
        ssl=getattr(settings, 'INFLUXDB_SSL', False),
        verify_ssl=getattr(settings, 'INFLUXDB_VERIFY_SSL', False),
    )
896925
def Get(self):
    """"""

    args = client_pb2.ApiGetClientArgs(client_id=self.client_id)
    result = self._context.SendRequest("GetClient", args)
    return Client(data=result, context=self._context)
631333
def instance(cls, hostname=None, auth=None, protocol=None, port=None, database=None):
        

        if cls.class_instance is None:
            if hostname is None and auth is None and protocol is None and port is None and database is None:
                cls.class_instance = Client(hostname='localhost')
            else:
                cls.class_instance = Client(hostname=hostname, auth=auth, protocol=protocol, port=port, database=database)
        else:
            if hostname is not None:
                cls.class_instance.hostname = hostname

            if protocol is not None:
                cls.class_instance.hostname = protocol

            if port is not None:
                cls.class_instance.hostname = port

            if database is not None:
                cls.class_instance.database = database

            if auth is not None:
                cls.class_instance.auth = auth

            cls.class_instance._create_api()

        return cls.class_instance
580689
def InstanceOf(cls, **kwargs):
    """"""
    return Property(types=cls, load=cls.load, **kwargs)
815702
def client(self, name=None):
        """"""
        name = name or self.default
        if not name:
            return NullClient(self, None, None)
        params = self.backends_hash[name]
        ccls = self.backends_schemas.get(params.scheme, TCPClient)
        return (yield from ccls(self, params.hostname, params.port).connect())
960587
def client(self, *args, **kwargs):
        

        return self._makeApiCall(self.funcinfo["client"], *args, **kwargs)
1325261
def server(self):
        """"""

        conn = self.connection_class(self)
        with self.mutex:
            self.connections.append(conn)
        return conn
579256
def get_focus_client(self):
        """"""
        widget = QApplication.focusWidget()
        for client in self.get_clients():
            if widget is client or widget is client.notebookwidget:
                return client
16942
def _get_instance(project_id, instance_zone, name, service):
    '''
    
    '''
    return service.instances().get(project=project_id,
                                   zone=instance_zone,
                                   instance=name).execute()
795891
def client(self):
        """"""

        if self._client is None:
            self._client = get_session(self.user_agent)
        return self._client