def stack_vars(stack):
    """Return a list of (name, value, depth) for all variables in
    the stack ``stack``."""
    result = []
    names = set()
    for scope in stack:
        for name in scope:
            names.add(name)
    def get_var(name):
        depth = len(stack)
        for scope in reversed(stack):
            depth -= 1
            if scope in name:
                return depth,scope[name]
    for name in sorted(names):
        depth, value = get_var(name)
        result.append((name, format_var(name, value), depth))
    return result
dataset/ETHPy150Open ravello/testmill/lib/testmill/state.py/stack_vars/swapped operands of `in`