code: def _try_tree_info(cmdline_args):
      with CmdlineParser.global_instance(cmdline_args):
          mode = gokart.tree_info().mode
          output_path = gokart.tree_info().output().path()
  
      # do nothing if `mode` is empty.
      if mode == "":
          return
  
      # output tree info and exit.
      if mode == "simple":
          _run_tree_info(cmdline_args, details=False)
      elif mode == "all":
          _run_tree_info(cmdline_args, details=True)
      else:
          raise ValueError(
              f'--tree-info-mode must be "simple" or "all", but "{mode}" is passed.'
          )
      logger.info(f"output tree info: {output_path}")
      sys.exit()
  
file_path: gokart/gokart/run.py
imports: import os
  import sys
  from logging import getLogger
  from typing import List, Optional
  import luigi
  import luigi.cmdline
  import luigi.retcodes
  from luigi.cmdline_parser import CmdlineParser
  import gokart
  import gokart.slack
  from gokart.object_storage import ObjectStorage
label_desc: Use image node_id 2 for calling a global function with example usage: _try_tree_info(cmdline_args) without return types