def rm_path(persist_path):
    if not os.path.exists(persist_path):
        return
    if os.path.isdir(persist_path):
        rm_func = shutil.rmtree
    elif os.path.isfile(persist_path):
        rm_func = os.unlink
    else:
        raise ValueError("Unknown how to `rm` path: %s" % (persist_path))
    try:
        rm_func(persist_path)
    except (__HOLE__, OSError):
        pass
dataset/ETHPy150Open openstack/taskflow/taskflow/examples/example_utils.py/rm_path