code: def test_repr_inheritance(shutdown_only):
      """Tests that a subclass's repr is used in logging."""
      logger = logging.getLogger(__name__)
  
      class MyClass:
          def __repr__(self) -> str:
              return (
                  "ThisIsMyCustomActorName"
                  + ray_constants.TESTING_NEVER_DEDUP_TOKEN
              )
  
          def do(self):
              logger.warning(
                  "text" + ray_constants.TESTING_NEVER_DEDUP_TOKEN
              )
  
      class MySubclass(MyClass):
          pass
  
      my_class_remote = ray.remote(MyClass)
      my_subclass_remote = ray.remote(MySubclass)
  
      f = io.StringIO()
      with redirect_stderr(f):
          my_class_actor = my_class_remote.remote()
          ray.get(my_class_actor.do.remote())
          # Wait a little to be sure that we have captured the output
          time.sleep(1)
          print("", flush=True)
          print("", flush=True, file=sys.stderr)
          f = f.getvalue()
          assert (
              "ThisIsMyCustomActorName" in f and "MySubclass" not in f
          )
  
      f2 = io.StringIO()
      with redirect_stderr(f2):
          my_subclass_actor = my_subclass_remote.remote()
          ray.get(my_subclass_actor.do.remote())
          # Wait a little to be sure that we have captured the output
          time.sleep(1)
          print("", flush=True, file=sys.stderr)
          f2 = f2.getvalue()
          assert (
              "ThisIsMyCustomActorName" in f2 and "MySubclass" not in f2
          )
  
imports: import io
  import os
  import re
  import subprocess
  import sys
  import tempfile
  import time
  import logging
  from collections import Counter, defaultdict
  from contextlib import redirect_stderr, redirect_stdout
  from pathlib import Path
  from unittest.mock import Mock, MagicMock
  import pytest
  import ray
  from ray._private import ray_constants
  from ray._private.log_monitor import LOG_NAME_UPDATE_INTERVAL_S, RAY_LOG_MONITOR_MANY_FILES_THRESHOLD, LogFileInfo, LogMonitor, is_proc_alive
  from ray._private.test_utils import get_log_batch, get_log_message, get_log_data, init_log_pubsub, run_string_as_driver, wait_for_condition
  from ray.cross_language import java_actor_class
  from ray.autoscaler._private.cli_logger import cli_logger
label_desc: Use image node_id 20 for calling a global function with example usage: test_repr_inheritance(shutdown_only) and returns: unknown