code: def test_call_matrix(shutdown_only):
      ray.init(object_store_memory=1000 * 1024 * 1024)
  
      @ray.remote
      class Actor:
          def small_value(self):
              return 0
  
          def large_value(self):
              return bytes(80 * 1024 * 1024)
  
          def echo(self, x):
              if isinstance(x, list):
                  x = ray.get(x[0])
              return x
  
      @ray.remote
      def small_value():
          return 0
  
      @ray.remote
      def large_value():
          return bytes(80 * 1024 * 1024)
  
      @ray.remote
      def echo(x):
          if isinstance(x, list):
              x = ray.get(x[0])
          return x
  
      def check(source_actor, dest_actor, is_large, out_of_band):
          print(
              "CHECKING",
              "actor" if source_actor else "task",
              "to",
              "actor" if dest_actor else "task",
              "large_object" if is_large else "small_object",
              "out_of_band" if out_of_band else "in_band",
          )
          if source_actor:
              a = Actor.remote()
              if is_large:
                  x_id = a.large_value.remote()
              else:
                  x_id = a.small_value.remote()
          else:
              if is_large:
                  x_id = large_value.remote()
              else:
                  x_id = small_value.remote()
          if out_of_band:
              x_id = [x_id]
          if dest_actor:
              b = Actor.remote()
              x = ray.get(b.echo.remote(x_id))
          else:
              x = ray.get(echo.remote(x_id))
          if is_large:
              assert isinstance(x, bytes)
          else:
              assert isinstance(x, int)
  
      for is_large in [False, True]:
          for source_actor in [False, True]:
              for dest_actor in [False, True]:
                  for out_of_band in [False, True]:
                      check(
                          source_actor,
                          dest_actor,
                          is_large,
                          out_of_band,
                      )
  
imports: import array
  import logging
  import os
  import random
  import subprocess
  import sys
  import tempfile
  import threading
  import time
  from unittest.mock import MagicMock, patch
  import pytest
  from ray._private.ray_constants import KV_NAMESPACE_FUNCTION_TABLE
  from ray._private.test_utils import client_test_enabled
  from ray.cluster_utils import Cluster, cluster_not_supported
  from ray.exceptions import GetTimeoutError, RayTaskError
  from ray.tests.client_test_utils import create_remote_signal_actor
label_desc: Use image node_id 4 for calling a global function with example usage: test_call_matrix(shutdown_only) and returns: int, bytes, x, int, bytes, x