code: def setup_logger(
      handler=[],
      quiet=False,
      printshellcmds=False,
      printreason=True,
      debug_dag=False,
      nocolor=False,
      stdout=False,
      debug=False,
      mode=None,
      show_failed_logs=False,
      dryrun=False,
  ):
      from snakemake.settings import Quietness
  
      if mode is None:
          mode = get_default_exec_mode()
  
      if quiet is None:
          # not quiet at all
          quiet = set()
      elif isinstance(quiet, bool):
          if quiet:
              quiet = {Quietness.PROGRESS, Quietness.RULES}
          else:
              quiet = set()
      elif not isinstance(quiet, set):
          raise ValueError(
              "Unsupported value provided for quiet mode (either bool, None or list allowed)."
          )
  
      logger.log_handler.extend(handler)
  
      # console output only if no custom logger was specified
      stream_handler = ColorizingStreamHandler(
          nocolor=nocolor,
          stream=sys.stdout if stdout else sys.stderr,
          mode=mode,
      )
      logger.set_stream_handler(stream_handler)
      logger.set_level(_logging.DEBUG if debug else _logging.INFO)
      logger.quiet = quiet
      logger.printshellcmds = printshellcmds
      logger.printreason = printreason
      logger.debug_dag = debug_dag
      logger.mode = mode
      logger.dryrun = dryrun
      logger.show_failed_logs = show_failed_logs
  
imports: import logging
  import platform
  import time
  import datetime
  import sys
  import os
  import json
  import threading
  from functools import partial
  import inspect
  import textwrap
label_desc: Use image node_id 5 for calling a global function with example usage: setup_logger(handler, quiet, printshellcmds, printreason, debug_dag, nocolor, stdout, debug, mode, show_failed_logs, dryrun) without return types