def openz(path, mode = "rb", closing = True):

    (_, extension) = os.path.splitext(path)

    if extension == ".bz2":
        file_ = bz2.BZ2File(path, mode)
    elif extension == ".gz":
        file_ = gzip.GzipFile(path, mode)
    elif extension == ".xz":
        raise NotImplementedError()
    else:
        return open(path, mode)

    if closing:
        return contextlib.closing(file_)
Ensures that the named bridge does not exist, eventually deletes it.
dataset/ETHPy150Open borg-project/borg/borg/util.py/openz--crossover with--dataset/ETHPy150Open saltstack/salt/salt/states/openvswitch_bridge.py/absent