<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def make_gpg_home(appname, config_dir=None):
 """ Make GPG keyring dir for a particular application. Return the path. """


    assert is_valid_appname(appname)
    config_dir = get_config_dir( config_dir )
    path = os.path.join( config_dir, "gpgkeys", appname )

    if not os.path.exists(path):
        os.makedirs( path, 0700 )
    else:
        os.chmod( path, 0700 )

    return path