code: def _gen_result_chunks(
      self,
      chunk_graph: ChunkGraph,
      next_tileable_handlers: List[_TileableHandler],
  ):
      result_chunks = chunk_graph.result_chunks
      tileable_graph = self._tileable_graph
      result_chunk_set = set(result_chunks)
  
      def _add_result_chunk(c):
          if c not in result_chunk_set:
              result_chunks.append(c)
              result_chunk_set.add(c)
  
      if next_tileable_handlers:
          for tileable_handler in next_tileable_handlers:
              tileable = tileable_handler.tileable
              # tileable that tile not completed, scan their inputs
              for inp_tileable in tileable_graph.iter_predecessors(
                  tileable
              ):
                  if (
                      tileable_handler.last_need_processes is None
                      or tileable_graph.count_successors(inp_tileable)
                      > 1
                  ):
                      # if nothing yielded inside its tile,
                      # or the input has more than 1 successors,
                      # make sure their chunks in result,
                      # so that they will not be executed repeatedly
                      if inp_tileable in self._tile_context:
                          for chunk in self._tile_context[
                              inp_tileable
                          ].chunks:
                              chunk = self._get_data(chunk)
                              if chunk in chunk_graph:
                                  _add_result_chunk(chunk)
      for tileable in tileable_graph.result_tileables:
          if tileable in self._tile_context:
              for chunk in self._tile_context[tileable].chunks:
                  chunk = self._get_data(chunk)
                  if chunk in chunk_graph:
                      _add_result_chunk(chunk)
                  if (
                      chunk in self._chunk_to_fetch
                      and self._chunk_to_fetch[chunk] in chunk_graph
                  ):
                      _add_result_chunk(self._chunk_to_fetch[chunk])
  
imports: import dataclasses
  import functools
  from typing import Callable, Dict, Generator, Iterable, List, Optional, Set, Type, Union
  from ....core import FUSE_CHUNK_TYPE, CHUNK_TYPE, TILEABLE_TYPE
  from ....typing import EntityType, TileableType, ChunkType
  from ....utils import copy_tileables, build_fetch
  from ...entity.tileables import handler
  from ...mode import enter_mode
  from ..entity import TileableGraph, ChunkGraph
  from .base import AbstractGraphBuilder
label_desc: Use image node_id 7 for calling the Tiler obj's underlying member method code with example usage: obj._gen_result_chunks(chunk_graph, next_tileable_handlers) without return types