human
Complete the below
def dfs(graph, root, visitor):

    ''''DFS over a graph.
    Start with node \'root\', calling \'visitor\' for every visited node.'
    '''
 What is a the Python program you requested?
assistant
#Here is the Python program you requested.
    visited = set()
    def dfs_walk(node):
        visited.add(node)
        visitor(node)
        for succ in graph.successors(node):
            if (not (succ in visited)):
                dfs_walk(succ)
    dfs_walk(root)