def repo_valid(path):
    with Repository(str(path), create=False) as repository:
        # can't check raises() because check() handles the error
        return repository.check()
utility function to check if borg can open a repository
dataset/ETHPy150Open borgbackup/borg/borg/testsuite/upgrader.py/repo_valid