code: def sorted_walk(dir):
      
      for base, dirs, files in os.walk(dir):
          dirs.sort()
          files.sort()
          yield base, dirs, files
docs: Do os.walk in a reproducible way,
      independent of indeterministic filesystem readdir order