code: def scrub_traceback(ex):
      assert isinstance(ex, str)
      print(ex)
      ex = ex.strip("\n")
      ex = re.sub("pid=[0-9]+,", "pid=XXX,", ex)
      ex = re.sub("ip=[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+", "ip=YYY", ex)
      ex = re.sub("repr=.*\)", "repr=ZZZ)", ex)
      ex = re.sub("line .*,", "line ZZ,", ex)
      ex = re.sub('".*"', '"FILE"', ex)
      # These are used to coloring the string.
      ex = re.sub("\\x1b\[36m", "", ex)
      ex = re.sub("\\x1b\[39m", "", ex)
      # When running bazel test with pytest 6.x, the module name becomes
      # "python.ray.tests.test_traceback" instead of just "test_traceback"
      # Also remove the "com_github_ray_project_ray" prefix, which may appear on Windows.
      ex = re.sub(
          r"(com_github_ray_project_ray.)?python\.ray\.tests\.test_traceback",
          "test_traceback",
          ex,
      )
      # Clean up object address.
      ex = re.sub("object at .*?>", "object at ADDRESS>", ex)
      # This is from ray.util.inspect_serializability()
      ex = re.sub(
          "=[\s\S]*Checking Serializability of[\s\S]*=",
          "INSPECT_SERIALIZABILITY",
          ex,
      )
      return ex
  
file_path: ray/python/ray/tests/test_traceback.py
imports: import re
  import sys
  import threading
  import pytest
  import ray
  from ray.exceptions import RayTaskError, RayActorError
label_desc: Use image node_id 1 for calling a global function with example usage: scrub_traceback(ex) and returns: ex