code: def _get_all_output_file_paths(task: gokart.TaskOnKart):
      output_paths = [
          t.path() for t in luigi.task.flatten(task.output())
      ]
      children = luigi.task.flatten(task.requires())
      output_paths.extend(
          itertools.chain.from_iterable(
              [_get_all_output_file_paths(child) for child in children]
          )
      )
      return output_paths
  
imports: import itertools
  import os
  import pathlib
  from logging import getLogger
  import luigi
  import gokart
label_desc: Use image node_id 1 for calling a global function with example usage: _get_all_output_file_paths(task) and returns: output_paths