code: def _check_inside_actor():
      """Check if currently it is inside a Ray actor/task."""
      worker = ray._private.worker.global_worker
      if worker.mode == ray.WORKER_MODE:
          return
      else:
          raise RuntimeError(
              "The collective APIs shall be only used inside a Ray actor or task."
          )
  
imports: import logging
  import os
  from typing import List
  import numpy
  import ray
  from ray.util.collective import types
label_desc: Use image node_id 28 for calling a global function with example usage: _check_inside_actor() without return types