def walk_files(root_dir):
    """Iterates under all the files under root_dir, yielding their filepath."""
    import os
    for base_dir, dirs, filenames in os.walk(root_dir):
        for filename in filenames:
            yield os.path.join(base_dir, filename)
