code: def detect_cycle_send(message, wait_response: bool = True):
      if (
          _debug_opts is None
          or not _debug_opts.log_cycle_send
          or not wait_response
      ):
          return
  
      cur_trace = (
          _message_trace_var.get(None) or []
      )  # type: List[MessageTraceItem]
      message.message_trace = cur_trace
  
      ref_key = (message.actor_ref.uid, message.actor_ref.address)
      traced_ref_keys = set(
          (item.uid, item.address) for item in cur_trace
      )
      if ref_key in traced_ref_keys:
          looped_trace = cur_trace + [
              MessageTraceItem(
                  uid=message.actor_ref.uid,
                  address=message.actor_ref.address,
                  method=message.content[0],
              )
          ]
  
          formatted_trace = "\n    ".join(
              f"Calling {t.method!r} in actor {t.uid} at {t.address}"
              for t in looped_trace
          )
          logger.warning(
              "Call cycle detected when sending to actor %s at %s, the trace is\n"
              "    %s",
              message.actor_ref.uid,
              message.actor_ref.address,
              formatted_trace,
          )
  
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 6 for calling a global function with example usage: detect_cycle_send(message, wait_response) without return types