code: def test_exception_chain(ray_start_regular):
      """Test the chained stacktrace."""
      expected_output = """ray::foo() (pid=XXX, ip=YYY) # noqa
    File "FILE", line ZZ, in foo
      return ray.get(bar.remote())
  ray.exceptions.RayTaskError(ZeroDivisionError): ray::bar() (pid=XXX, ip=YYY)
    File "FILE", line ZZ, in bar
      return 1 / 0
  ZeroDivisionError: division by zero"""
  
      @ray.remote
      def bar():
          return 1 / 0
  
      @ray.remote
      def foo():
          return ray.get(bar.remote())
  
      r = foo.remote()
      try:
          ray.get(r)
      except ZeroDivisionError as ex:
          assert isinstance(ex, RayTaskError)
          print(ex)
          assert clean_noqa(expected_output) == scrub_traceback(str(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 6 for calling a global function with example usage: test_exception_chain(ray_start_regular) and returns: unknown, ray