code: def handle_commands(cmds) -> None:
      def handle_command(cmd):
          logging.info("Executing command: %s", cmd)
          check_call(shlex.split(cmd))
  
      if type(cmds) is list:
          for cmd in cmds:
              handle_commands(cmd)
      elif type(cmds) is str:
          handle_command(cmds)
      elif callable(cmds):
          cmds()
      else:
          raise RuntimeError(
              "handle_commands(cmds): argument should be str or List[str] but is %s",
              type(cmds),
          )
  
imports: import argparse
  import os
  import sys
  from subprocess import check_call
  import shlex
  from ci.util import retry, remember_cwd
  from typing import List
  from collections import OrderedDict
  import logging
  import yaml
  import shutil
label_desc: Use image node_id 6 for calling a global function with example usage: handle_commands(cmds) without return types