<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_dir(path, args, state):
 """ Check all files in `path' to see if there is any requests that we should send out on the bus. """

    if args.debug:
        sys.stderr.write("Walking %s\n" % path)

    for root, _dirs, files in os.walk(path):
        if not safe_process_files(root, files, args, state):
            return False
        if state.should_quit():
            return False
    return True