def valid_key (k, aging_hash, frequency_threshold):
    """Determine whether or not this key k is valid, based on number of appearances versus the specified threshold"""

    purge_expired(aging_hash)
    current_val = update_aging_hash(aging_hash, k)
    return current_val[1] <= frequency_threshold


# public methods
dataset/ETHPy150Open dpapathanasiou/intelligent-smtp-responder/server/anti_spam.py/valid_key/original