def get_data_home(data_home=None):
    """Return the path of the msmbuilder data dir.

    As of msmbuilder v3.6, this function will prefer data downloaded via
    the msmb_data conda package (and located within the python installation
    directory). If this package exists, we will use its data directory as
    the data home. Otherwise, we use the old logic:

    This folder is used by some large dataset loaders to avoid
    downloading the data several times.

    By default the data dir is set to a folder named 'msmbuilder_data'
    in the user's home folder.

    Alternatively, it can be set by the 'MSMBUILDER_DATA' environment
    variable or programmatically by giving an explicit folder path. The
    '~' symbol is expanded to the user home folder.

    If the folder does not already exist, it is automatically created.
    """
    if data_home is not None:
        return _expand_and_makedir(data_home)

    msmb_data = has_msmb_data()
    if msmb_data is not None:
        return _expand_and_makedir(msmb_data)

    data_home = environ.get('MSMBUILDER_DATA', join('~', 'msmbuilder_data'))
    return _expand_and_makedir(data_home)
Return the path of the msmbuilder data dir.

    As of msmbuilder v3.6, this function will prefer data downloaded via
    the msmb_data conda package (and located within the python installation
    directory). If this package exists, we will use its data directory as
    the data home. Otherwise, we use the old logic:

    This folder is used by some large dataset loaders to avoid
    downloading the data several times.

    By default the data dir is set to a folder named 'msmbuilder_data'
    in the user's home folder.

    Alternatively, it can be set by the 'MSMBUILDER_DATA' environment
    variable or programmatically by giving an explicit folder path. The
    '~' symbol is expanded to the user home folder.

    If the folder does not already exist, it is automatically created.