code: def test_basic_pinning(one_worker_100MiB):
      @ray.remote
      def f(array):
          return np.sum(array)
  
      @ray.remote
      class Actor(object):
          def __init__(self):
              # Hold a long-lived reference to a ray.put object's ID. The object
              # should not be garbage collected while the actor is alive because
              # the object is pinned by the raylet.
              self.large_object = ray.put(
                  np.zeros(25 * 1024 * 1024, dtype=np.uint8)
              )
  
          def get_large_object(self):
              return ray.get(self.large_object)
  
      actor = Actor.remote()
  
      # Fill up the object store with short-lived objects. These should be
      # evicted before the long-lived object whose reference is held by
      # the actor.
      for batch in range(10):
          intermediate_result = f.remote(
              np.zeros(10 * 1024 * 1024, dtype=np.uint8)
          )
          ray.get(intermediate_result)
  
      # The ray.get below would fail with only LRU eviction, as the object
      # that was ray.put by the actor would have been evicted.
      ray.get(actor.get_large_object.remote())
  
imports: import copy
  import logging
  import os
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray.cluster_utils
  from ray._private.test_utils import SignalActor, convert_actor_state, kill_actor_and_wait_for_failure, put_object, wait_for_condition, skip_flaky_core_test_premerge
label_desc: Use image node_id 7 for calling a global function with example usage: test_basic_pinning(one_worker_100MiB) and returns: np, ray