<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def walk_dependencies(root, visitor):
 """ 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)`. """

    def visit(parent, visitor):
        for d in get_dependencies(parent):
            visitor(d, parent)
            visit(d, visitor)

    visitor(root, None)
    visit(root, visitor)