class_docstr: Class for managing threads which run concurrent Spark jobs.
  
  This maintains a primary dispatcher thread, plus 1 thread per Hyperopt trial.
  Each trial's thread runs 1 Spark job with 1 task.
code: def _cancel_running_trials(self):
      if self.trials._spark_supports_job_cancelling:
          logger.debug(
              "Cancelling all running jobs in job group {g}".format(
                  g=self._job_group_id
              )
          )
          self.spark.sparkContext.cancelJobGroup(self._job_group_id)
          # Make a copy of trials by slicing
          for trial in self.trials.trials[:]:
              if trial["state"] in [
                  base.JOB_STATE_NEW,
                  base.JOB_STATE_RUNNING,
              ]:
                  trial["state"] = base.JOB_STATE_CANCEL
      else:
          logger.info(
              "Because the current Apache PySpark version does not support "
              "cancelling jobs by job group ID, SparkTrials will block until all of "
              "its running Spark jobs finish."
          )
  
imports: import copy
  import os
  import threading
  import time
  import timeit
  import traceback
  from hyperopt import base, fmin, Trials
  from hyperopt.base import validate_timeout, validate_loss_threshold, STATUS_OK
  from hyperopt.utils import coarse_utcnow, _get_logger, _get_random_id
label_desc: Use image node_id 13 for calling the _SparkFMinState obj's underlying member method code with example usage: obj._cancel_running_trials() without return types