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


# Null-friendly comparison functions
dataset/ETHPy150Open potatolondon/djangae/djangae/db/utils.py/key_exists/swapped operands of `>`