def walk_up(bottom):
import os<EOL>from os import path<EOL>bottom = path.realpath(bottom)<EOL>try:<EOL><INDENT>names = os.listdir(bottom)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise e<EOL><DEDENT>dirs, nondirs = [], []<EOL>for name in names:<EOL><INDENT>if path.isdir(path.join(bottom, name)):<EOL><INDENT>dirs.append(name)<EOL><DEDENT>else:<EOL><INDENT>nondirs.append(name)<EOL><DEDENT><DEDENT>yield bottom, dirs, nondirs<EOL>new_path = path.realpath(path.join(bottom, '<STR_LIT:..>'))<EOL>if new_path == bottom:<EOL><INDENT>return<EOL><DEDENT>for x in walk_up(new_path):<EOL><INDENT>yield x<EOL><DEDENT>
mimic os.walk, but walk 'up' instead of down the directory tree
    :param bottom:
    :return: