code: def walk_dependencies(root, visitor):
      
      def visit(parent, visitor):
          for d in get_dependencies(parent):
              visitor(d, parent)
              visit(d, visitor)
  
      visitor(root, None)
      visit(root, visitor)
docs: Call visitor on root and all dependencies reachable from it in breadth
      first order.
  
      Args:
          root (component): component function or class
          visitor (function): signature is `func(component, parent)`.  The
              call on root is `visitor(root, None)`.