code: def _check_run_from_job_result(
      sagemaker_session,
      tc_name=None,
      is_init=True,
      has_extra_load=False,
  ):
      def validate_tc_updated_in_init():
          assert tc.start_time
          assert tc.end_time
          assert (
              tc.status.primary_status
              == _TrialComponentStatusType.Completed.value
          )
          assert tc.parameters["p1"] == 1.0
          assert tc.parameters["p2"] == 2.0
          assert len(tc.metrics) == 5
          for metric_summary in tc.metrics:
              # metrics deletion is not supported at this point
              # so its count would accumulate
              assert metric_summary.count > 0
              assert metric_summary.min == 0.0
              assert metric_summary.max == 1.0
  
      def validate_tc_updated_in_load():
          assert tc.parameters["p3"] == 3.0
          assert tc.parameters["p4"] == 4.0
          assert len(tc.metrics) > 0
          for metric_summary in tc.metrics:
              if (
                  metric_summary.metric_name
                  != "test-job-load-log-metric"
              ):
                  continue
              assert metric_summary.last == 0.1
              assert metric_summary.max == 0.1
              assert metric_summary.min == 0.1
          if has_extra_load:
              assert tc.parameters["p5"] == 5.0
              assert tc.parameters["p6"] == 6.0
  
      tc = _TrialComponent.load(
          trial_component_name=tc_name,
          sagemaker_session=sagemaker_session,
      )
      if is_init:
          # Add retry since the load behavior is inconsistent sometimes
          retry_with_backoff(validate_tc_updated_in_init, 4)
      else:
          retry_with_backoff(validate_tc_updated_in_load, 4)
  
imports: from __future__ import absolute_import
  import datetime
  import json
  import os
  import time
  import pytest
  from tests.conftest import CUSTOM_S3_OBJECT_KEY_PREFIX
  from tests.integ.sagemaker.experiments.conftest import TAGS
  from sagemaker.experiments._api_types import _TrialComponentStatusType
  from sagemaker.experiments._utils import is_run_trial_component
  from sagemaker.processing import FrameworkProcessor
  from sagemaker.pytorch import PyTorch
  from sagemaker.s3 import S3Uploader
  from sagemaker.xgboost import XGBoostModel
  from tests.integ import DATA_DIR
  from sagemaker.experiments._metrics import BATCH_SIZE
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.sklearn import SKLearn
  from sagemaker.utils import retry_with_backoff, unique_name_from_base
  from tests.integ.sagemaker.experiments.helpers import name, cleanup_exp_resources
  from sagemaker.experiments.run import RUN_NAME_BASE, DELIMITER
  from sagemaker.experiments import Run, load_run, list_runs
  from sagemaker.experiments._helper import _DEFAULT_ARTIFACT_PREFIX
label_desc: Use image node_id 17 for calling a global function with example usage: _check_run_from_job_result(sagemaker_session, tc_name, is_init, has_extra_load) without return types