<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def global_data_dir():
 """Return the global Intake catalog dir for the current environment"""

    prefix = False
    if VIRTUALENV_VAR in os.environ:
        prefix = os.environ[VIRTUALENV_VAR]
    elif CONDA_VAR in os.environ:
        prefix = sys.prefix
    elif which('conda'):
        # conda exists but is not activated
        prefix = conda_prefix()

    if prefix:
        # conda and virtualenv use Linux-style directory pattern
        return make_path_posix(os.path.join(prefix, 'share', 'intake'))
    else:
        return appdirs.site_data_dir(appname='intake', appauthor='intake')