def recoverPath(volume, start, end):
    if not volume:
        return None
    p = []
    current = start
    while current != end:
        p.append(current)
        successors = [[current[0] + i, current[1] + j] for (i,j) in [(1,0), (0, 1), (-1, 0), (0, -1)]]
        for v in volume:
            if list(v) in successors and not list(v) in p:
                current = list(v)
                continue
    p.append(end)
    return p
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/util.py/recoverPath/original