code: def _check_tc_status_intermediate(
      trial_component,
      sagemaker_session,
      init_start_time,
      old_end_time=None,
  ):
      tc_load = _TrialComponent.load(
          trial_component_name=trial_component.trial_component_name,
          sagemaker_session=sagemaker_session,
      )
      assert (
          abs(
              tc_load.start_time.timestamp()
              - init_start_time.timestamp()
          )
          < 1
      )
      assert (
          tc_load.status.primary_status
          == _TrialComponentStatusType.InProgress.value
      )
      if not old_end_time:
          assert not trial_component.end_time
          return
      assert isinstance(tc_load.end_time, datetime.datetime)
      assert tc_load.end_time == old_end_time
  
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 20 for calling a global function with example usage: _check_tc_status_intermediate(trial_component, sagemaker_session, init_start_time, old_end_time) without return types