code: def test_internal_free(shutdown_only):
      ray.init(num_cpus=1)
  
      @ray.remote
      class Sampler:
          def sample(self):
              return [1, 2, 3, 4, 5]
  
          def sample_big(self):
              return np.zeros(1024 * 1024)
  
      sampler = Sampler.remote()
  
      # Free deletes from in-memory store.
      obj_ref = sampler.sample.remote()
      ray.get(obj_ref)
      ray._private.internal_api.free(obj_ref)
      with pytest.raises(ObjectFreedError):
          ray.get(obj_ref)
  
      # Free deletes big objects from plasma store.
      big_id = sampler.sample_big.remote()
      ray.get(big_id)
      ray._private.internal_api.free(big_id)
      time.sleep(1)  # wait for delete RPC to propagate
      with pytest.raises(ObjectFreedError):
          ray.get(big_id)
  
imports: import json
  import logging
  import os
  import sys
  import time
  import numpy
  import pytest
  import ray._private.profiling
  import ray.cluster_utils
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import client_test_enabled, wait_for_condition
  from ray.exceptions import ObjectFreedError
label_desc: Use image node_id 1 for calling a global function with example usage: test_internal_free(shutdown_only) and returns: list, np