code: def dump_task_info_tree(
      task: TaskOnKart,
      task_info_dump_path: str,
      ignore_task_names: Optional[List[str]] = None,
      use_unique_id: bool = True,
  ):
      """Dump the task info tree object (TaskInfo) to a pickle file.
  
      Parameters
      ----------
      - task: TaskOnKart
          Root task.
      - task_info_dump_path: str
          Output target file path. Path destination can be `local`, `S3`, or `GCS`.
          File extension must be '.pkl'.
      - ignore_task_names: Optional[List[str]]
          List of task names to ignore.
      - use_unique_id: bool = True
          Whether to use unique id to dump target file. Default is True.
      Returns
      -------
      None
      """
      extension = os.path.splitext(task_info_dump_path)[1]
      assert (
          extension == ".pkl"
      ), f"File extention must be `.pkl`, not `{extension}`."
  
      task_info_tree = make_task_info_tree(
          task, ignore_task_names=ignore_task_names
      )
  
      unique_id = task.make_unique_id() if use_unique_id else None
  
      task_info_target = make_target(
          file_path=task_info_dump_path, unique_id=unique_id
      )
      task_info_target.dump(obj=task_info_tree, lock_at_dump=False)
  
file_path: gokart/gokart/tree/task_info.py
imports: import os
  from typing import List, Optional
  import pandas
  from gokart.target import make_target
  from gokart.task import TaskOnKart
  from gokart.tree.task_info_formatter import make_task_info_tree, make_tree_info, make_tree_info_table_list
label_desc: Use image node_id 4 for calling a global function with example usage: dump_task_info_tree(task, task_info_dump_path, ignore_task_names, use_unique_id) without return types