code: def _wait_and_assert_that_no_rule_jobs_errored(training_job):
      # Wait for all rule jobs to complete.
      # Training job completion takes takes ~5min after training job ends
      # 120 retries * 10s sleeps = 20min timeout
      for _ in retries(
          max_retry_count=120,
          exception_message_prefix="Waiting for all jobs to be in success status or any to be in error",
          seconds_to_sleep=10,
      ):
          job_description = training_job.describe()
          debug_rule_evaluation_statuses = job_description.get(
              "DebugRuleEvaluationStatuses"
          )
          if not debug_rule_evaluation_statuses:
              break
          incomplete_rule_job_found = False
          for (
              debug_rule_evaluation_status
          ) in debug_rule_evaluation_statuses:
              assert (
                  debug_rule_evaluation_status["RuleEvaluationStatus"]
                  != "Error"
              )
              if (
                  debug_rule_evaluation_status["RuleEvaluationStatus"]
                  not in _NON_ERROR_TERMINAL_RULE_JOB_STATUSES
              ):
                  incomplete_rule_job_found = True
          if not incomplete_rule_job_found:
              break
  
imports: from __future__ import absolute_import
  import os
  import uuid
  import pytest
  from sagemaker.debugger.debugger import DebuggerHookConfig, Rule, rule_configs, TensorBoardOutputConfig
  from sagemaker.mxnet.estimator import MXNet
  from sagemaker.pytorch.estimator import PyTorch
  from sagemaker.tensorflow.estimator import TensorFlow
  from sagemaker.xgboost.estimator import XGBoost
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.retry import retries
  from tests.integ.timeout import timeout
label_desc: Use image node_id 15 for calling a global function with example usage: _wait_and_assert_that_no_rule_jobs_errored(training_job) without return types