code: def valid_exceptions(use_force):
      if use_force:
          return (
              RayTaskError,
              TaskCancelledError,
              WorkerCrashedError,
              ObjectLostError,
          )
      else:
          return (RayTaskError, TaskCancelledError)
  
file_path: ray/python/ray/tests/test_client_terminate.py
imports: import sys
  import time
  import pytest
  from ray._private.test_utils import convert_actor_state, wait_for_condition
  from ray.exceptions import GetTimeoutError, ObjectLostError, RayTaskError, TaskCancelledError, WorkerCrashedError
  from ray.tests.client_test_utils import create_remote_signal_actor
  from ray.util.client.ray_client_helpers import ray_start_client_server
label_desc: Use image node_id 1 for calling a global function with example usage: valid_exceptions(use_force) and returns: RayTaskError,  TaskCancelledError,  WorkerCrashedError,  ObjectLostError, RayTaskError,  TaskCancelledError