def _generate_filename_to_mtime(self):
    filename_to_mtime = {}
    num_files = 0
    for dirname, dirnames, filenames in os.walk(self._directory,
                                                followlinks=True):
      for filename in filenames + dirnames:
        if num_files == 10000:
          warnings.warn(
              'There are too many files in your application for '
              'changes in all of them to be monitored. You may have to '
              'restart the development server to see some changes to your '
              'files.')
          return filename_to_mtime
        num_files += 1
        path = os.path.join(dirname, filename)
        try:
          mtime = os.path.getmtime(path)
        except (IOError, __HOLE__):
          pass
        else:
          filename_to_mtime[path] = mtime
    return filename_to_mtime
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/mtime_file_watcher.py/MtimeFileWatcher._generate_filename_to_mtime