<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gnupg_home():
 """Returns appropriate arguments if GNUPGHOME is set"""

    if 'GNUPGHOME' in os.environ:
        gnupghome = os.environ['GNUPGHOME']
        if not os.path.isdir(gnupghome):
            raise CryptoritoError("Invalid GNUPGHOME directory")

        return ["--homedir", gnupghome]
    else:
        return []