code: def objwalk(self, obj, path=(), memo=None):
          
  
          # dual python 2/3 compatability, inspired by the "six" library
          string_types = (str, unicode) if str is bytes else (str, bytes)
          iteritems = lambda mapping: getattr(mapping, 'iteritems', mapping.items)()
  
          if memo is None:
              memo = set()
          iterator = None
          if isinstance(obj, Mapping):
              iterator = iteritems
          elif isinstance(obj, (Sequence, Set)) and not isinstance(obj, string_types):
              iterator = enumerate
          if iterator:
              if id(obj) not in memo:
                  memo.add(id(obj))
                  for path_component, value in iterator(obj):
                      for result in self.objwalk(value, path + (path_component,), memo):
                          yield result
                  memo.remove(id(obj))
          else:
              yield path, obj
docs: Traverse a dictionary recursively and save path
  
          Taken from:
    http://code.activestate.com/recipes/577982-recursively-walk-python-objects/