def key_exists(key):
    qry = Query(keys_only=True, namespace=key.namespace())
    qry.Ancestor(key)
    return qry.Count(limit=1) > 0


# Null-friendly comparison functions
dataset/ETHPy150Open potatolondon/djangae/djangae/db/utils.py/key_exists/original