

def walkdict(obj, key):
    'Take a JSON object and key and return the first matched value from the object.'
    stack = obj.items()
    while stack:
        (k, v) = stack.pop()
        out(('key: %s value: %s' % (k, v)))
        if isinstance(v, dict):
            stack.extend(v.iteritems())
        elif (k == key):
            return stack
    return None

dataset/ETHPy150Open miklevin/pipulate/common.py walkdict/VarMisuse@84/131 `v`->`stack`