def get_repo_parent(path):
    # path is a repository
    if is_repo(path):
        return Local(path)

    # path is inside a repository
    elif not os.path.isdir(path):
        _rel = ''
        while path and path != '/':
            if is_repo(path):
                return Local(path)
            else:
                _rel = os.path.join(os.path.basename(path), _rel)
                path = os.path.dirname(path)
        return path
Returns parent repo or input path if none found.
dataset/ETHPy150Open rsgalloway/grit/grit/repo/local.py/get_repo_parent