code: def test_function_table_gc(call_ray_start):
      """This test tries to verify that function table is cleaned up
      after job exits.
      """
  
      def f():
          data = "0" * 1024 * 1024  # 1MB
  
          @ray.remote
          def r():
              nonlocal data
  
              @ray.remote
              class Actor:
                  pass
  
          return r.remote()
  
      ray.init(address="auto", namespace="b")
  
      # It should use > 500MB data
      ray.get([f() for _ in range(500)])
  
      # It's not working on win32.
      if sys.platform != "win32":
          assert get_gcs_memory_used() > 500 * 1024 * 1024
      job_id = (
          ray._private.worker.global_worker.current_job_id.hex().encode()
      )
      assert function_entry_num(job_id) > 0
      ray.shutdown()
  
      # now check the function table is cleaned up after job finished
      ray.init(address="auto", namespace="a")
      wait_for_condition(
          lambda: function_entry_num(job_id) == 0, timeout=30
      )
  
imports: import os
  import sys
  import time
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.test_utils import Semaphore, enable_external_redis, client_test_enabled, run_string_as_driver, wait_for_condition, get_gcs_memory_used, run_string_as_driver_nonblocking
  from ray.experimental.internal_kv import _internal_kv_list
  from ray.tests.conftest import call_ray_start
  import subprocess
  import psutil
label_desc: Use image node_id 5 for calling a global function with example usage: test_function_table_gc(call_ray_start) and returns: r