code: def _check_secondary_status(sagemaker_client, job_name):
      desc = sagemaker_client.describe_training_job(
          TrainingJobName=job_name
      )
      secondary_status_transitions = desc.get(
          "SecondaryStatusTransitions"
      )
      if not secondary_status_transitions:
          return False
  
      latest_secondary_status_transition = secondary_status_transitions[
          -1
      ]
      secondary_status = latest_secondary_status_transition.get(
          "Status"
      )
      status_message = latest_secondary_status_transition.get(
          "StatusMessage"
      )
      return (
          TRAINING_STATUS == secondary_status
          and ALGO_PULL_FINISHED_MESSAGE == status_message
      )
  
file_path: sagemaker-python-sdk/tests/integ/test_profiler.py
imports: from __future__ import absolute_import
  import os
  import time
  import uuid
  import pytest
  from sagemaker.debugger import DebuggerHookConfig, FrameworkProfile, ProfilerConfig, ProfilerRule, Rule, rule_configs
  from sagemaker.debugger.metrics_config import DetailedProfilingConfig
  from sagemaker.mxnet.estimator import MXNet
  from sagemaker.utils import unique_name_from_base
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.timeout import timeout
label_desc: Use image node_id 2 for calling a global function with example usage: _check_secondary_status(sagemaker_client, job_name) and returns: unknown, False