Return encoded ID token.
350824
def encode_id_token(self, id_token):
        

        # Encode the ID token using the `client_secret`.
        #
        # TODO: Using the `client_secret` is not ideal, since it is transmitted
        # over the wire in some authentication flows.  A better alternative is
        # to use the public key of the issuer, which also allows the ID token to
        # be shared among clients. Doing so however adds some operational
        # costs. We should consider this for the future.

        secret = id_token.access_token.client.client_secret

        return id_token.encode(secret)
313800
function getRequestId(req) {
  const id = uuid.v1();
  req.id = id;
  return {
    req_id: id,
  };
}
591251
def doc2id(self, doc):
        
        doc = map(self.process_token, doc)
        return [self.token_to_id(token) for token in doc]
238620
def tokens2ids(tokens: Iterable[str], vocab: Dict[str, int]) -> List[int]:
    
    return [vocab.get(w, vocab[C.UNK_SYMBOL]) for w in tokens]
723644
def decode(self, ids):
    """"""
    ids = text_encoder.pad_decr(ids)
    subword_ids = ids
    del ids

    subwords = []

    # Some ids correspond to bytes. Because unicode characters are composed of
    # possibly multiple bytes, we attempt to decode contiguous lists of bytes
    # all together. Invalid byte sequences are replaced with the unicode
    # replacement (i.e. unknown) character U+FFFD.
    prev_bytes = []

    def consume_prev_bytes():
      if prev_bytes:
        bytestr = b"".join(prev_bytes)
        bytes_text = bytestr.decode("utf-8", "replace")
        subwords.append(bytes_text)
      return []

    for subword_id in subword_ids:
      subword = self._id_to_subword(subword_id)
      if isinstance(subword, six.binary_type):
        # Byte-encoded
        prev_bytes.append(subword)
      else:
        # If there were bytes previously, convert to unicode.
        prev_bytes = consume_prev_bytes()
        trimmed, add_space = _trim_underscore_and_tell(subword)
        subwords.append(trimmed)
        if add_space:
          subwords.append(" ")
    # If there were trailing bytes, convert to unicode.
    prev_bytes = consume_prev_bytes()

    return tf.compat.as_text("".join(subwords))
617079
def retrieve_secret_id(url, token):
    """"""
    import hvac
    client = hvac.Client(url=url, token=token)
    response = client._post('/v1/sys/wrapping/unwrap')
    if response.status_code == 200:
        data = response.json()
        return data['data']['secret_id']
608911
def decode_id_token(token, client):
    
    keys = get_client_alg_keys(client)
    return JWS().verify_compact(token, keys=keys)
1171988
def t_ID(self, t):
        '
        t.type = self.reserved_words.get(t.value, 'ID')
        return t
858422
def signed_encoding_url(id, factory_id, opts = {})
      data, _status_code, _headers = signed_encoding_url_with_http_info(id, factory_id, opts)
      return data
    end
946744
def getClientUID(self):
        
        client = api.get_parent(self)
        if not client:
            return ""
        return api.get_uid(client)
474920
private String stringId() throws RecognitionException {
        if ( input.LA( 1 ) == DRL5Lexer.ID ) {
            Token id = match( input,
                              DRL5Lexer.ID,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return id.getText();
        } else if ( input.LA( 1 ) == DRL5Lexer.STRING ) {
            Token id = match( input,
                              DRL5Lexer.STRING,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            return StringUtils.unescapeJava( safeStripStringDelimiters( id.getText() ) );
        } else {
            throw new MismatchedTokenException( DRL5Lexer.ID,
                                                input );
        }
    }
1088220
def encode(self, s):
    """"""
    s = tf.compat.as_text(s)
    tokens = self._tokenizer.tokenize(s)
    tokens = _prepare_tokens_for_encode(tokens)
    ids = []
    for token in tokens:
      ids.extend(self._token_to_ids(token))
    return text_encoder.pad_incr(ids)
666675
def _get_id(self):
        """"""
        id = self._options.get('id')
        if id:
            return id

        id = uuid.uuid4().hex
        self.update_options(id=id)
        return id
788267
def get_token(self, token):
        '''
        
        '''
        load = {}
        load['token'] = token
        load['cmd'] = 'get_token'
        tdata = self._send_token_request(load)
        return tdata
1288369
def nice_identifier():
    ''
    big = reduce(mul, struct.unpack('<LLLL', os.urandom(16)), 1)
    big = big % 2**128
    return uuid.UUID(int=big).hex
1131467
def get_id(self):
        """"""
        if self._id_attr is None or not hasattr(self, self._id_attr):
            return None
        return getattr(self, self._id_attr)
1022916
def get_ID_text(token):
    
    if isinstance(token, CommonToken):
        text = token.text
    else:
        text = token.getText()

    text = text.lstrip('\\')
    return text