code: def test_oversized_function(ray_start_shared_local_modes):
      bar = bytearray(800 * 1024 * 125)
  
      @ray.remote
      class Actor:
          def foo(self):
              return len(bar)
  
      @ray.remote
      def f():
          return len(bar)
  
      with pytest.raises(
          ValueError, match="The remote function .*f is too large"
      ):
          f.remote()
  
      with pytest.raises(
          ValueError, match="The actor Actor is too large"
      ):
          Actor.remote()
  
imports: import logging
  import os
  import pickle
  import random
  import sys
  import time
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import SignalActor, client_test_enabled, get_error_message, run_string_as_driver
label_desc: Use image node_id 27 for calling a global function with example usage: test_oversized_function(ray_start_shared_local_modes) and returns: len, len