def _generate_filename_to_mtime(self):
    """Records the state of a directory.

    Returns:
      A dictionary of subdirectories and files under
      directory associated with their timestamps.
      the keys are absolute paths and values are epoch timestamps.

    Raises:
      ShutdownError: if the quit event has been fired during processing.
    """
    filename_to_mtime = {}
    num_files = 0
    for dirname, dirnames, filenames in os.walk(self._directory,
                                                followlinks=True):
      if self._quit_event.is_set():
        raise ShutdownError()
      watcher_common.skip_ignored_dirs(dirnames)
      filenames = [f for f in filenames if not watcher_common.ignore_file(f)]
      for filename in filenames + dirnames:
        if self._quit_event.is_set():
          raise ShutdownError()
        if num_files == _MAX_MONITORED_FILES:
          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:
          filename_to_mtime[path] = os.path.getmtime(path)
        except (__HOLE__, OSError):
          pass
    return filename_to_mtime
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/mtime_file_watcher.py/MtimeFileWatcher._generate_filename_to_mtime