code: def breadth_first(
      root: "Component", types: Type["ComponentTuple"] = None
  ):
      """Returns a generator that walks through the tree of components breadth-first.
  
      Arguments:
          root: The root component of the tree
          types: If provided, only the component types in this list will be visited.
  
      """
      yield from _BreadthFirstVisitor(root, types)
  
file_path: pytorch-lightning/src/lightning/app/utilities/tree.py
imports: from typing import TYPE_CHECKING, Type
  import lightning.app
label_desc: Use image node_id 1 for calling a global function with example usage: breadth_first(root, types) without return types