def _store_url_and_get_key(url):
    while True:
        key = generate_random_key()
        if storage.set(key, url):
            break
    return key
def _store_url_and_get_key(url):
    while True:
        key = generate_random_key()
        if storage.set(key, url):
            break
    return key