'Return the directory to which packages will be downloaded by
default.  This value can be overridden using the constructor,
or on a case-by-case basis using the ``download_dir`` argument when
calling ``download()``.
On Windows, the default download directory is
``PYTHONHOME/lib/nltk``, where *PYTHONHOME* is the
directory containing Python, e.g. ``C:\Python25``.
On all other platforms, the default directory is the first of
the following which exists or which can be created with write
permission: ``/usr/share/nltk_data``, ``/usr/local/share/nltk_data``,
``/usr/lib/nltk_data``, ``/usr/local/lib/nltk_data``, ``~/nltk_data``.'

def default_download_dir(self):

    if (u'APPENGINE_RUNTIME' in os.environ):
        return
    for nltkdir in nltk.data.path:
        if (os.path.exists(nltkdir) and nltk.internals.is_writable(nltkdir)):
            return nltkdir
    if ((sys.platform == u'win32') and (u'APPDATA' in os.environ)):
        homedir = os.environ[u'APPDATA']
    else:
        homedir = os.path.expanduser(u'~/')
        if (homedir == u'~/'):
            raise ValueError(u'Could    not    find    a    default    download    directory')
    return os.path.join(homedir, u'nltk_data')
