def rm(path):
    """removes path and dirs going up until a OSError"""
    os.remove(path)
    try:
        os.removedirs(os.path.split(path)[0])
    except __HOLE__:
        pass
dataset/ETHPy150Open Floobits/floobits-sublime/floo/common/utils.py/rm