code: def test_traceback():
      from inspect import (
          currentframe,
          getframeinfo,
      )
  
      # do not move lines below among themselves -- we rely on consistent line numbers ;)
      tb_line = getframeinfo(currentframe()).lineno + 2
  
      def rec(tb, n):
          return rec(tb, n - 1) if n else tb()
  
      tb1 = rec(TraceBack(), 10)
      ok_endswith(
          tb1,
          ">test_log:%d,%s"
          % (tb_line + 1, ",".join([str(tb_line)] * 10)),
      )
  
      # we limit to the last 100
      tb1 = rec(TraceBack(collide=True), 110)
      ok_endswith(
          tb1, "…>test_log:%s" % (",".join([str(tb_line)] * 100))
      )
  
imports: import inspect
  import logging
  import os.path
  from logging import makeLogRecord
  from os.path import exists
  from unittest.mock import patch
  from datalad import cfg
  from datalad.log import ColorFormatter, LoggerHelper, TraceBack, log_progress, with_progress, with_result_progress
  from datalad.support import ansi_colors
  from datalad.support.constraints import EnsureBool
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_in, assert_no_open_files, assert_not_in, assert_re_in, known_failure_githubci_win, ok_, ok_endswith, ok_generator, swallow_logs, with_tempfile
  from datalad.utils import on_windows
label_desc: Use image node_id 6 for calling a global function with example usage: test_traceback() and returns: unknown