Get a nonce to use in a request, removing it from the nonces on hand.
6267
def _get_nonce(self, url):
        
        action = LOG_JWS_GET_NONCE()
        if len(self._nonces) > 0:
            with action:
                nonce = self._nonces.pop()
                action.add_success_fields(nonce=nonce)
                return succeed(nonce)
        else:
            with action.context():
                return (
                    DeferredContext(self.head(url))
                    .addCallback(self._add_nonce)
                    .addCallback(lambda _: self._nonces.pop())
                    .addCallback(tap(
                        lambda nonce: action.add_success_fields(nonce=nonce)))
                    .addActionFinish())
782442
function nonce(len) {
  var buf = []
    , chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
    , charlen = chars.length;

  for (var i = 0; i < len; ++i) {
    buf.push(chars[Math.random() * charlen | 0]);
  }

  return buf.join('');
}
1010099
def rest_del(self, url, params=None, auth=None, verify=True, cert=None):
        
        res = requests.delete(url, params=params, auth=auth, verify=verify, cert=cert)
        return res.text, res.status_code
169414
def get_nonce(block_representation, coin_symbol='btc', api_key=None):
    '''
    
    '''
    return get_block_overview(block_representation=block_representation,
            coin_symbol=coin_symbol, txn_limit=1, api_key=api_key)['bits']
143088
private String makeNonce(String timestamp) {
		byte[] bytes = new byte[10];
		random.nextBytes(bytes);
		StringBuilder sb = new StringBuilder(timestamp);
		sb.append("-");
		for (int i = 0; i < bytes.length; ++i) {
			String b = Integer.toHexString(bytes[i] & 0xff);
			if (b.length() < 2) {
				sb.append("0");
			}
			sb.append(b);
		}
		return sb.toString();
	}
1181574
def remove_alert(thing_name, key, session=None):
    
    return _request('get', '/remove/alert/for/{0}'.format(thing_name), params={'key': key}, session=session)
739017
async def request(self, request):
        
        assert request.transaction_id not in self.transactions

        if self.integrity_key:
            self.__add_authentication(request)

        transaction = stun.Transaction(request, self.server, self)
        self.transactions[request.transaction_id] = transaction
        try:
            return await transaction.run()
        finally:
            del self.transactions[request.transaction_id]
968131
def make_duplicate_request(request):
    
    class FakeRequest(object):
        method = 'GET'
        path = request.path
        headers = request.headers
        GET = request.GET
        POST = request.POST
        user = getattr(request, 'user', None)
        cookies = request.cookies
        is_xhr = request.is_xhr
    return FakeRequest()
72567
def skip(self, ns):
        
        return ns in (None, Namespace.default, Namespace.xsdns, Namespace.xsins, Namespace.xmlns)
770300
public byte[] sign(byte[] nonce) {
        try {
            char[] keyChars = this.readKeyChars();
            NKey nkey =  NKey.fromSeed(keyChars);
            byte[] sig = nkey.sign(nonce);
            nkey.clear();
            return sig;
        } catch (Exception exp) {
            throw new IllegalStateException("problem signing nonce", exp);
        }
    }
75365
def _clean_item(self, request_url):
        
        del self._table[request_url]
        self._usage_recency.remove(request_url)
433565
def _request(self, method, identifier, key=None, value=None):
        """"""
        params = {'id': identifier}
        if key is not None and value is not None:
            params[key] = value
        result = yield from self._transact(method, params)
        return result.get(key)
443378
def check_nonce(self, nonce):
        
        lower, upper = self.nonce_length
        return (set(nonce) <= self.safe_characters and
                lower <= len(nonce) <= upper)
385821
def free(self, request_key):
        
        state = self.get(request_key)
        if not state:
            return
        state.forwardedTo -= 1
        self._clean(state)
214229
def process_request(self, unused_request):
    """"""
    # Compare to the first half of toplevel() in context.py.
    tasklets._state.clear_all_pending()
    # Create and install a new context.
    ctx = tasklets.make_default_context()
    tasklets.set_context(ctx)
1033564
def rest_del(self, url, params=None, session=None, verify=True, cert=None):
        
        res = session.delete(url, params=params, verify=verify, cert=cert)
        return res.text, res.status_code
628227
def unauth(request):
    
    if check_key(request):
        api = get_api(request)
        request.session.clear()
        logout(request)
    return HttpResponseRedirect(reverse('main'))