<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def verify(sigfilename, filefilename=None):
 """Verifies a signature, returns True if successful else False."""


    if gnupg is None:
        return False

    gpg = gnupg.GPG()

    with open(sigfilename, "rb") as sigfile:
        verified = gpg.verify_file(sigfile, filefilename)

        pyspread_keyid = fingerprint2keyid(config["gpg_key_fingerprint"])

        if verified.valid and verified.key_id == pyspread_keyid:
            return True

    return False