<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_gpg_key(fingerprint):
 """Checks to see if we have this gpg fingerprint"""

    if len(fingerprint) > 8:
        fingerprint = fingerprint[-8:]

    fingerprint = fingerprint.upper()
    cmd = flatten([gnupg_bin(), gnupg_home(), "--list-public-keys"])
    lines = stderr_output(cmd).split('\n')
    return len([key for key in lines if key.find(fingerprint) > -1]) == 1