code: def test_actor_method_metadata_cache(ray_start_regular):
      class Actor(object):
          pass
  
      # The cache of _ActorClassMethodMetadata.
      cache = ray.actor._ActorClassMethodMetadata._cache
      cache.clear()
  
      # Check cache hit during ActorHandle deserialization.
      A1 = ray.remote(Actor)
      a = A1.remote()
      assert len(cache) == 1
      cached_data_id = [id(x) for x in list(cache.items())[0]]
      for x in range(10):
          a = pickle.loads(pickle.dumps(a))
      assert len(ray.actor._ActorClassMethodMetadata._cache) == 1
      assert [id(x) for x in list(cache.items())[0]] == cached_data_id
  
imports: import datetime
  import os
  import random
  import sys
  import tempfile
  import numpy
  import pytest
  import ray
  from ray import cloudpickle
  from ray._private import ray_constants
  from ray._private.test_utils import client_test_enabled, wait_for_condition, wait_for_pid_to_exit
  from ray.actor import ActorClassInheritanceException
  from ray.tests.client_test_utils import create_remote_signal_actor
  from ray._private.test_utils import SignalActor
  import setproctitle
label_desc: Use image node_id 10 for calling a global function with example usage: test_actor_method_metadata_cache(ray_start_regular) without return types