code: def traverse(self, visit, *args, **kwargs):
          
          if not self.__visited:
              visit(self, *args, **kwargs)
              self.__visited = True
              self._traverse(visit, *args, **kwargs)
              self.__visited = False
docs: Traverse the hierarchy performing `visit(self, *args, **kwargs)`
          at every node passed by downwards. This function includes self!
  
          See *visitor pattern* in literature. This is implemented in pre-order fashion.
  
          Example::
  
              #Collect all children:
  
              children = []
              self.traverse(children.append)
              print children