Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def walk(node, callback):
  if node is None:
    return
  for key in node:
    item = node[key] if isinstance(node, dict) else key
    if isinstance(item, (list, set, dict)):
      walk(item, callback)
    else:
      callback(item, key, node)
        


src/g/r/grow-0.0.27/grow/common/utils_test.py   grow(Download)
    actual = []
    callback = lambda item, key, node: actual.append(item)
    utils.walk(data, callback)
 
    expected = ['bar', 'bar2', 'bar3', 'bar4']

src/p/y/pygrow-HEAD/grow/common/utils_test.py   pygrow(Download)
    actual = []
    callback = lambda item, key, node: actual.append(item)
    utils.walk(data, callback)
 
    expected = ['bar', 'bar2', 'bar3', 'bar4']