code: def make_tree_info_table_list(
      task_info: TaskInfo, visited_tasks: Set[str]
  ):
      task_id = task_info.get_task_id()
      if task_id in visited_tasks:
          return []
      visited_tasks.add(task_id)
  
      result = [task_info.task_info_dict()]
  
      children = task_info.children_task_infos
      for child in children:
          result += make_tree_info_table_list(
              task_info=child, visited_tasks=visited_tasks
          )
      return result
  
file_path: gokart/gokart/tree/task_info_formatter.py
imports: import typing
  import warnings
  from dataclasses import dataclass
  from typing import Dict, List, NamedTuple, Optional, Set, Union
  import luigi
  from gokart.task import TaskOnKart
label_desc: Use image node_id 4 for calling a global function with example usage: make_tree_info_table_list(task_info, visited_tasks) and returns: result, list