code: def test_run_from_transform_job(
      sagemaker_session,
      dev_sdk_tar,
      xgboost_latest_version,
      execution_role,
      sagemaker_client_config,
      sagemaker_metrics_config,
  ):
      # Notes:
      # 1. The 1st Run (run) created locally
      # 2. In the inference script running in a transform job, load the 1st Run twice and log data
      # 1) via explicitly passing the experiment_name and run_name of the 1st Run
      # 2) use load_run() without explicitly supplying the names
      # 3. All data are logged in the Run either locally or in the transform job
      exp_name = unique_name_from_base(_EXP_NAME_BASE_IN_SCRIPT)
      xgb_model_data_s3 = sagemaker_session.upload_data(
          path=os.path.join(_TRANSFORM_MATERIALS, "xgb_model.tar.gz"),
          key_prefix="integ-test-data/xgboost/model",
      )
      env = _update_env_with_client_config(
          env={
              "EXPERIMENT_NAME": exp_name,
              "RUN_NAME": _RUN_NAME_IN_SCRIPT,
          },
          sagemaker_metrics_config=sagemaker_metrics_config,
          sagemaker_client_config=sagemaker_client_config,
      )
      xgboost_model = XGBoostModel(
          sagemaker_session=sagemaker_session,
          model_data=xgb_model_data_s3,
          role=execution_role,
          entry_point="inference.py",
          source_dir=_EXP_DIR,
          framework_version=xgboost_latest_version,
          env=env,
      )
      transformer = xgboost_model.transformer(
          instance_count=1,
          instance_type="ml.m5.4xlarge",
          max_concurrent_transforms=5,
          max_payload=1,
          strategy="MultiRecord",
      )
      uri = "s3://{}/{}/input/data/{}".format(
          sagemaker_session.default_bucket(),
          "transform-test",
          unique_name_from_base("json-data"),
      )
      input_data = S3Uploader.upload(
          os.path.join(_TRANSFORM_MATERIALS, "data.csv"),
          uri,
          sagemaker_session=sagemaker_session,
      )
  
      with cleanup_exp_resources(
          exp_names=[exp_name], sagemaker_session=sagemaker_session
      ):
          with Run(
              experiment_name=exp_name,
              run_name=_RUN_NAME_IN_SCRIPT,
              sagemaker_session=sagemaker_session,
          ) as run:
              _local_run_log_behaviors(
                  is_complete_log=False,
                  sagemaker_session=sagemaker_session,
              )
              transformer.transform(
                  data=input_data,
                  content_type="text/libsvm",
                  split_type="Line",
                  wait=True,
                  logs=False,
                  job_name=f"transform-job-{name()}",
              )
  
          _check_run_from_local_end_result(
              tc=run._trial_component,
              sagemaker_session=sagemaker_session,
              is_complete_log=False,
          )
          tc_name = Run._generate_trial_component_name(
              experiment_name=run.experiment_name, run_name=run.run_name
          )
          _check_run_from_job_result(
              tc_name=tc_name,
              sagemaker_session=sagemaker_session,
              is_init=False,
              has_extra_load=True,
          )
  
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 9 for calling a global function with example usage: test_run_from_transform_job(sagemaker_session, dev_sdk_tar, xgboost_latest_version, execution_role, sagemaker_client_config, sagemaker_metrics_config) without return types