def stored_cookie_messages_count(storage, response):
    # Get a list of cookies, excluding ones with a max-age of 0 (because
    # they have been marked for deletion).
    cookie = response.cookies.get(storage.cookie_name)
    if not cookie or cookie['max-age'] == 0:
        return 0
    data = storage._decode(cookie.value)
    if not data:
        return 0
    if data[-1] == CookieStorage.not_finished:
        data.pop()
    return len(data)
Return a python long integer with k random bits.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/messages/tests/cookie.py/stored_cookie_messages_count--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Random/random.py/StrongRandom.getrandbits