code: def record_message_trace(message):
      if _debug_opts is None or not _debug_opts.log_cycle_send:
          yield
      else:
          msg_trace = list(message.message_trace or [])
          msg_trace.append(
              MessageTraceItem(
                  uid=message.actor_ref.uid,
                  address=message.actor_ref.address,
                  method=message.content[0],
              )
          )
          _message_trace_var.set(msg_trace)
          try:
              yield
          finally:
              _message_trace_var.set(None)
  
imports: import asyncio.tasks
  import contextvars
  import json
  import logging
  import os
  import time
  from contextlib import contextmanager
  from dataclasses import dataclass
  from typing import List, Optional
  from ..utils import dataslots
label_desc: Use image node_id 5 for calling a global function with example usage: record_message_trace(message) without return types