<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_keys(hint=None, private=False):
 """ Returns a generator of all keys containing the fingerprint, or all keys if hint is None. The generator may raise exceptions of :class:gpg.errors.GPGMEError, and it is the caller's responsibility to handle them. :param hint: Part of a fingerprint to usee to search :type hint: str or None :param private: Whether to return public keys or secret keys :type private: bool :returns: A generator that yields keys. :rtype: Generator[gpg.gpgme.gpgme_key_t, None, None] """

    ctx = gpg.core.Context()
    return ctx.keylist(hint, private)