base.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:ramp-workflow 作者: paris-saclay-cds 项目源码 文件源码
def get_data_home(ramp_kits_home=None):
    """Return the path of the ramp-kits data dir.

    This folder is used to fetch the up-to-date ramp-kits

    By default the data dir is set to a folder named 'ramp-kits'
    in the user home folder.

    Alternatively, it can be set by the 'RAMP-KITS' 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 ramp_kits_home is None:
        ramp_kits_home = environ.get('RAMP-KITS',
                                     join('~', 'ramp-kits'))
        ramp_kits_home = expanduser(ramp_kits_home)
    if not exists(ramp_kits_home):
        makedirs(ramp_kits_home)

    return ramp_kits_home
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号