code: def _log_stderr(name, fnc, args, kwargs, is_return):
      global __stream_write, __stream_flush, __trace_level, __trace_start, __thread_id
      # noinspection PyBroadException
      try:
          if is_return and __trace_level not in (-1, -2):
              return
          if __trace_level not in (1, 2, -1, -2):
              return
          fnc_address = str(fnc).split(" at ")
          fnc_address = (
              "{}".format(fnc_address[-1].replace(">", ""))
              if len(fnc_address) > 1
              else ""
          )
          if __trace_level == 1 or __trace_level == -1:
              t = "{:14} {}".format(fnc_address, name)
          elif __trace_level == 2 or __trace_level == -2:
              a_args = str(args)[1:-1] if args else ""
              a_kwargs = " {}".format(kwargs) if kwargs else ""
              t = "{:14} {} ({}{})".format(
                  fnc_address, name, a_args, a_kwargs
              )
          # get a nicer thread id
          h = int(__thread_id())
          ts = time.time() - __trace_start
          __stream_write(
              "{}{:<9.3f}:{:5}:{:8x}: [{}] {}\n".format(
                  "-" if is_return else "",
                  ts,
                  os.getpid(),
                  h,
                  threading.current_thread().name,
                  t,
              )
          )
          if __stream_flush:
              __stream_flush()
      except Exception:
          pass
  
file_path: clearml/clearml/debugging/trace.py
imports: import os
  import sys
  import threading
  import inspect
  import time
  import zipfile
label_desc: Use image node_id 3 for calling a global function with example usage: _log_stderr(name, fnc, args, kwargs, is_return) without return types