code: def valid_exceptions(use_force):
      if use_force:
          return (
              RayTaskError,
              TaskCancelledError,
              WorkerCrashedError,
              ObjectLostError,
          )
      else:
          return TaskCancelledError
  
imports: import os
  import random
  import signal
  import sys
  import threading
  import _thread
  import time
  import pytest
  import ray
  from ray.exceptions import TaskCancelledError, RayTaskError, GetTimeoutError, WorkerCrashedError, ObjectLostError
  from ray._private.utils import DeferSigint
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.util.state import list_tasks
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, TaskCancelledError