code: def trace(type, **kwargs):
      assert not TRACE_RESERVED_KEYS.intersection(
          kwargs.keys()
      ), f".trace() keyword parameters cannot include {TRACE_RESERVED_KEYS}"
      task_id = get_task_id()
      if task_id is None:
          yield kwargs
          return
      tracer = tracers.get(task_id)
      if tracer is None:
          yield kwargs
          return
      start = time.perf_counter()
      yield kwargs
      end = time.perf_counter()
      trace_info = {
          "type": type,
          "start": start,
          "end": end,
          "duration_ms": (end - start) * 1000,
          "traceback": traceback.format_list(
              traceback.extract_stack(limit=6)[:-3]
          ),
      }
      trace_info.update(kwargs)
      tracer.append(trace_info)
  
file_path: datasette/datasette/tracer.py
imports: import asyncio
  from contextlib import contextmanager
  from contextvars import ContextVar
  from markupsafe import escape
  import time
  import json
  import traceback
label_desc: Use image node_id 3 for calling a global function with example usage: trace(type) without return types