code: def raise_exception_from_futures(futures):
      """Raises a RuntimeError if any of the futures indicates an exception"""
      errs = [f.exception() for f in futures if f.exception()]
      if errs:
          raise RuntimeError(
              "%d of %d worker jobs failed: %s"
              % (len(errs), len(futures), ", ".join(map(str, errs)))
          )
  
imports: from threading import Lock
  from asyncio import InvalidStateError
  from cuml.internals.import_utils import check_min_dask_version
  from cuml.common import device_of_gpu_matrix
  from dask.distributed import default_client, wait
  import time
  import random
  import dask
  import logging
  import os
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 9 for calling a global function with example usage: raise_exception_from_futures(futures) without return types