Return the client identifier as included in many command replies.
437118
def client_ident(self):
        
        return irc.client.NickMask.from_params(
            self.nick, self.user,
            self.server.servername)
221817
def GetLabelFromFleetspeak(client_id):
  """"""
  res = fleetspeak_connector.CONN.outgoing.ListClients(
      admin_pb2.ListClientsRequest(client_ids=[GRRIDToFleetspeakID(client_id)]))
  if not res.clients or not res.clients[0].labels:
    return fleetspeak_connector.unknown_label

  for label in res.clients[0].labels:
    if label.service_name != "client":
      continue
    if label.label in fleetspeak_connector.label_map:
      return fleetspeak_connector.label_map[label.label]

  return fleetspeak_connector.unknown_label
935313
def id(opts):
    '''
    
    '''
    r = salt.utils.http.query(opts['proxy']['url']+'id', decode_type='json', decode=True)
    return r['dict']['id'].encode('ascii', 'ignore')
135981
def id(self):
        """"""
        id = ''
        if (self.server_and_prefix is not None and
                self.server_and_prefix != ''):
            id += self.server_and_prefix + '/'
        if (self.identifier is not None):
            id += self.identifier
        return id
1195898
private function identifyClientFromRequest()
  {
    $clientId   = $this->getRequest()->input('client_id', '');
    $clientSecret = $this->getRequest()->input('client_secret', null);
    $redirectUri  = $this->getRequest()->input('redirect_uri', null);

    try {
      $this->accessToken  = $this->getResource()->determineAccessToken();

      $sessionRepository = new FluentSession();
      $sesion      = $sessionRepository->validateAccessToken($this->accessToken);

      if ($sesion !== false) {
        $clientId   = $sesion['client_id'];
        $clientSecret = $sesion['client_secret'];
      }

      unset($sessionRepository);
      unset($sesion);
    } catch (InvalidAccessTokenException $e) {}

    if ( ! empty($clientId)) {
      $clientRepository = new FluentClient();
      $client       = $clientRepository->getClient($clientId, $clientSecret, $redirectUri);

      if ($client !== false) {
        $client['id']   = $clientId;
        $client['secret'] = $client['client_secret'];

        unset($client['client_id']);
        unset($client['client_secret']);
        unset($client['redirect_uri']);
        unset($client['metadata']);

        $this->client = new OauthClient();

        $this->client->fill($client);
        $this->client->exists = true;
        $this->client->syncOriginal();
      }

      unset($client);
      unset($clientRepository);
    }

    unset($clientId);
    unset($clientSecret);
    unset($redirectUri);
  }
981869
def GetInput(self):
    """"""
    clients = GetAllClients(token=self.token)
    logging.debug("Got %d clients", len(clients))
    return clients
1232265
def getClientSSLContext(self):
        '''
        
        '''
        sslctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
        self._loadCasIntoSSLContext(sslctx)

        return sslctx
787286
def sequential_id(self, client):
        """"""
        if client.client_id not in self._sequential_ids:
            id_ = sequential_id("e:{0}:users".format(self.name), client.client_id)
            self._sequential_ids[client.client_id] = id_
        return self._sequential_ids[client.client_id]
652597
function() {
        switch(self.command) {          
            case constants.WHOIS:
                return (self.params[0][0] == 'A');
            case constants.PASSWORD:
                return true;
            case constants.NUMERICINFO:
            case constants.GENERALINFO: // client-to-server
                return (self.params.length < 2) || (self.params[0][0] == 'c');
            case constants.SERVERMESSAGE:
                return true;
            default:
                return false;
        }
    }
473045
def client(self, id):
    """"""

    return self.query(Client).filter(Client.id==id).one()
1189078
def identify_id(id: str) -> bool:
    
    return re.match(r'^https?://', id, flags=re.IGNORECASE) is not None
208975
def identify(self, req, resp, resource, uri_kwargs):
        """"""
        header = req.get_header("Authorization", False)
        auth = header.split(" ") if header else None

        if auth is None or auth[0].lower() != 'basic':
            return None

        if len(auth) != 2:
            raise HTTPBadRequest(
                "Invalid Authorization header",
                "The Authorization header for Basic auth should be in form:\n"
                "Authorization: Basic <base64-user-pass>"
            )

        user_pass = auth[1]

        try:
            decoded = base64.b64decode(user_pass).decode()

        except (TypeError, UnicodeDecodeError, binascii.Error):
            raise HTTPBadRequest(
                "Invalid Authorization header",
                "Credentials for Basic auth not correctly base64 encoded."
            )

        username, _, password = decoded.partition(":")
        return username, password
1285555
def retrieve_client_credentials(self):
        
        client_id = self.params.get('client_id')
        client_secret = self.params.get('client_secret')
        return (client_id, client_secret)
1330163
def who(self, *args):
        """"""
        if len(self._users) == 0:
            self.log('No users connected')
            if len(self._clients) == 0:
                self.log('No clients connected')
                return

        Row = namedtuple("Row", ['User', 'Client', 'IP'])
        rows = []

        for user in self._users.values():
            for key, client in self._clients.items():
                if client.useruuid == user.uuid:
                    row = Row(user.account.name, key, client.ip)
                    rows.append(row)

        for key, client in self._clients.items():
            if client.useruuid is None:
                row = Row('ANON', key, client.ip)
                rows.append(row)

        self.log("\n" + std_table(rows))
441927
private static String getIdentifier(String target) {

        // check map
        String id = LOCATION_IDENTIFIER_MAP.get(target);
        if (id == null) {
            id = LOCATION_IDENTIFIER_PREFIX + target;
            LOCATION_IDENTIFIER_MAP.put(target, id);
        }
        return id;

    }
598526
async def identify(self):
        """"""
        payload = {
            'op': self.IDENTIFY,
            'd': {
                'token': self.token,
                'properties': {
                    '$os': sys.platform,
                    '$browser': 'discord.py',
                    '$device': 'discord.py',
                    '$referrer': '',
                    '$referring_domain': ''
                },
                'compress': True,
                'large_threshold': 250,
                'v': 3
            }
        }

        if not self._connection.is_bot:
            payload['d']['synced_guilds'] = []

        if self.shard_id is not None and self.shard_count is not None:
            payload['d']['shard'] = [self.shard_id, self.shard_count]

        state = self._connection
        if state._activity is not None or state._status is not None:
            payload['d']['presence'] = {
                'status': state._status,
                'game': state._activity,
                'since': 0,
                'afk': False
            }

        await self.send_as_json(payload)
        log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
74370
def make_random_client_id(self):
        
        if PY2:
            return ('py_%s' %
                    base64.b64encode(str(random.randint(1, 0x40000000))))
        else:
            return ('py_%s' %
                    base64.b64encode(bytes(str(random.randint(1, 0x40000000)),
                                     'ascii')))