def METHOD_NAME(
    self,
    filter_func: Callable[
        [interfaces.objects.ObjectInterface], bool
    ] = lambda _: False,
):
    """Generates the Tree of processes."""
    kernel = self.context.modules[self.config["kernel"]]
    for proc in pslist.PsList.list_processes(
        self.context, kernel.layer_name, kernel.symbol_table_name
    ):
        if not self.config.get("physical", pslist.PsList.PHYSICAL_DEFAULT):
            offset = proc.vol.offset
        else:
            layer_name = kernel.layer_name
            memory = self.context.layers[layer_name]
            (_, _, offset, _, _) = list(
                memory.mapping(offset=proc.vol.offset, length=0)
            )[0]
        self._processes[proc.UniqueProcessId] = proc, offset
    # Build the child/level maps
    for pid in self._processes:
        self.find_level(pid, filter_func)
    process_pids = set([])
    def yield_processes(pid, descendant: bool = False):
        if pid in process_pids:
            vollog.debug(f"Pid cycle: already processed pid {pid}")
            return
        process_pids.add(pid)
        if pid not in self._ancestors and not descendant:
            vollog.debug(f"Pid cycle: pid {pid} not in filtered tree")
            return
        proc, offset = self._processes[pid]
        row = (
            proc.UniqueProcessId,
            proc.InheritedFromUniqueProcessId,
            proc.ImageFileName.cast(
                "string", max_length=proc.ImageFileName.vol.count, errors="replace"
            ),
            format_hints.Hex(offset),
            proc.ActiveThreads,
            proc.get_handle_count(),
            proc.get_session_id(),
            proc.get_is_wow64(),
            proc.get_create_time(),
            proc.get_exit_time(),
        )
        yield (self._levels[pid] - 1, row)
        for child_pid in self._children.get(pid, []):
            yield from yield_processes(
                child_pid, descendant or not filter_func(proc)
            )
    for pid in self._levels:
        if self._levels[pid] == 1:
            yield from yield_processes(pid)