Get a client's ID.  Uses GET to /clients?name=<client> interface.

        :Args:
            * *client*: (str) Client's name

        :Returns: (str) Client id
438697
def client_id(self, client):
        

        params = {
            "name": client
        }

        response = self._get(url.clients, params=params)
        self._check_response(response, 200)
        return self._create_response(response).get("client_id")
660083
def client_setname(self, name):
        """"""
        fut = self.execute(b'CLIENT', b'SETNAME', name)
        return wait_ok(fut)
314557
def _GetClientIdFromQueue(q):
  
  split = q.Split()
  if not split or len(split) < 2:
    return None

  # Normalize to lowercase.
  split = [s.lower() for s in split]

  str_client_id, tasks_marker = split

  if not str_client_id.startswith("c.") or tasks_marker != "tasks":
    return None

  # The "C." prefix should be uppercase.
  str_client_id = "C" + str_client_id[1:]

  return str_client_id
338837
def _get_client_from_cache(self, client_id):
        
        data = self._read_uaa_cache()

        # Only if we've cached any for this issuer
        if self.uri not in data:
            return

        for client in data[self.uri]:
            if client['id'] == client_id:
                return client
494609
def get_customer(self, customer_id):
        
        return self.client._get(self.url + 'customers/{}'.format(customer_id), headers=self.get_headers())
35491
def fetch_by_client_id(self, client_id):
        
        if client_id not in self.clients:
            raise ClientNotFoundError

        return self.clients[client_id]
604238
def _client_data(self, client):
        
        data = {}
        if client:
            data['obj'] = client
            data['id'] = client.id
            data['url'] = client.absolute_url()
            data['name'] = to_utf8(client.getName())
        return data
482069
def find_by_id(self, project, params={}, **options): 
        
        path = "/projects/%s" % (project)
        return self.client.get(path, params, **options)
1166028
private String getClientIndex(Client client) {
        return getClientIndex(client.getOrganizationId(), client.getClientId(), client.getVersion());
    }
646026
def make_fixed_client_id(self):
        
        machine = platform.node()
        process = os.getpid()
        thread = threading.currentThread().getName()
        return base64.b64encode('%s|%s|%s' % (machine, process, thread))
717804
def get_name(self):
        """"""
        if self.given_name is None:
            # Name according to host
            if self.hostname is None:
                name = _("Console")
            else:
                name = self.hostname
            # Adding id to name
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = name + u' ' + client_id
        elif self.given_name in ["Pylab", "SymPy", "Cython"]:
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = self.given_name + u' ' + client_id
        else:
            name = self.given_name + u'/' + self.id_['str_id']
        return name
286228
def get_current_client_name(self, short=False):
        """"""
        client = self.get_current_client()
        if client:
            if short:
                return client.get_short_name()
            else:
                return client.get_filename()
1128640
def get_client_data(self, client):
        
        data = self._request('GET', '/clients/{}'.format(client))
        return data.json()
201936
def getClientUID(self):
        
        request = self.getRequest()
        if request:
            client = request.getClient()
            if client:
                return client.UID()
92816
def get_client_index_from_id(self, client_id):
        """"""
        for index, client in enumerate(self.clients):
            if id(client) == client_id:
                return index
616453
def _get_client_by_id(self, client_id):
    
    client = self.grr_api.Client(client_id)
    print('Checking for client approval')
    self._check_approval_wrapper(client, client.ListFlows)
    print('{0:s}: Client approval is valid'.format(client_id))
    return client.Get()
851948
def get_by_name(self, name):
        
        scopes = self._client.get_all()
        result = [x for x in scopes if x['name'] == name]
        return result[0] if result else None