code: def run(cmdline_args=None, set_retcode=True):
      cmdline_args = cmdline_args or sys.argv[1:]
  
      if set_retcode:
          luigi.retcodes.retcode.already_running = 10
          luigi.retcodes.retcode.missing_data = 20
          luigi.retcodes.retcode.not_run = 30
          luigi.retcodes.retcode.task_failed = 40
          luigi.retcodes.retcode.scheduling_error = 50
  
      _try_tree_info(cmdline_args)
      _try_to_delete_unnecessary_output_file(cmdline_args)
      gokart.testing.try_to_run_test_for_empty_data_frame(cmdline_args)
  
      slack_api = _try_get_slack_api(cmdline_args)
      event_aggregator = gokart.slack.EventAggregator()
      try:
          event_aggregator.set_handlers()
          luigi.cmdline.luigi_run(cmdline_args)
      except SystemExit as e:
          _try_to_send_event_summary_to_slack(
              slack_api, event_aggregator, cmdline_args
          )
          sys.exit(e.code)
  
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 6 for calling a global function with example usage: run(cmdline_args, set_retcode) without return types