misc.py 文件源码

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

项目:sequana 作者: sequana 项目源码 文件源码
def on_cluster(pattern=["tars-"]):
    """Used to check if we are on a cluster

    "tars-" is the name of a cluster's hostname.
    Change or append the argument **pattern** with your cluster's hostname

    :param str pattern: a list of names (strings) or a string

    """
    if isinstance(pattern, str):
        pattern = [pattern]

    for this in pattern:
        if platform.uname().node.startswith(this):
            return True
        else:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号