code: def _try_to_send_event_summary_to_slack(
      slack_api: Optional[gokart.slack.SlackAPI],
      event_aggregator: gokart.slack.EventAggregator,
      cmdline_args: List[str],
  ):
      if slack_api is None:
          # do nothing
          return
      options = gokart.slack.SlackConfig()
      with CmdlineParser.global_instance(cmdline_args) as cp:
          task = cp.get_task_obj()
          tree_info = (
              gokart.make_tree_info(task, details=True)
              if options.send_tree_info
              else "Please add SlackConfig.send_tree_info to include tree-info"
          )
          task_name = type(task).__name__
  
      comment = (
          f"Report of {task_name}"
          + os.linesep
          + event_aggregator.get_summary()
      )
      content = os.linesep.join(
          [
              "===== Event List ====",
              event_aggregator.get_event_list(),
              os.linesep,
              "==== Tree Info ====",
              tree_info,
          ]
      )
      slack_api.send_snippet(
          comment=comment, title="event.txt", content=content
      )
  
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 5 for calling a global function with example usage: _try_to_send_event_summary_to_slack(slack_api, event_aggregator, cmdline_args) without return types