def METHOD_NAME(root: bytes) -> Iterator[rdf_timeline.TimelineEntry]:
  """Walks the filesystem collecting stat information.
  This method will recursively descend to all sub-folders and sub-sub-folders
  and so on. It will stop the recursion at device boundaries and will not follow
  any symlinks (to avoid cycles and virtual filesystems that may be potentially
  infinite).
  Args:
    root: A path to the root folder at which the recursion should start.
  Returns:
    An iterator over timeline entries with stat information about each file.
  Raises:
    OSError: If it is not possible to collect information about the root folder.
    ValueError: If the specified root path is not absolute.
  """
  if not os.path.isabs(root):
    raise ValueError("Requested to traverse a non-root path")
  # We fully expand the root path in order for the timeline entries to have
  # the real path associated with them.
  root = os.path.realpath(root)
  # This might raise if there is a problem when accessing the path (e.g. it does
  # not exist). While for recursive walking we generally want to ignore such
  # errors (because given the multitude of files we are going to traverse there
  # are likely going to be permission errors for some of them), if we fail to
  # collect information about the root then likely something is wrong and the
  # flow should fail, giving the user a meaningful error message.
  dev = os.lstat(root).st_dev
  def Recurse(path: bytes) -> Iterator[rdf_timeline.TimelineEntry]:
    """Performs the recursive walk over the file hierarchy."""
    try:
      stat = statx.Get(path)
    except OSError:
      return
    yield rdf_timeline.TimelineEntry.FromStatx(path, stat)
    # We want to recurse only to folders on the same device.
    if not stat_mode.S_ISDIR(stat.mode) or stat.dev != dev:
      return
    try:
      childnames = os.listdir(path)
    except OSError:
      childnames = []
    # TODO(hanuszczak): Implement more efficient auto-batcher instead of having
    # multi-level iterators.
    for childname in childnames:
      for entry in Recurse(os.path.join(path, childname)):
        yield entry
  return Recurse(root)