human
Complete the below
def fake_os_walk(paths):

    ''''Helper function for mocking os.walk() where must test that manipulation
    of the returned dirs variable works as expected'
    '''

=====
Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    paths_dict = dict(paths)
    def os_walk(top, topdown=True):
        (dirs, nondirs) = paths_dict[top]
        (yield (top, dirs, nondirs))
        for name in dirs:
            new_path = '/'.join([top, name])
            for x in os_walk(new_path, topdown):
                (yield x)
    return os_walk