def addresses_for_key(gpg, key):
    """
    Takes a key and extracts the email addresses for it.
    """
    return [address.split("<")[-1].strip(">")
            for address in gpg.list_keys().key_map[key['fingerprint']]["uids"]
            if address]
def addresses_for_key ( gpg , key ) : return [ address . split ( "<" ) [ - 1 ] . strip ( ">" ) for address in gpg . list_keys ( ) . key_map [ key [ 'fingerprint' ] ] [ "uids" ] if address ]
Takes a key and extracts the email addresses for it.