code: def test_run_load_no_run_name_and_in_train_job(
      mock_run_env,
      sagemaker_session,
      kwargs,
      expected_artifact_bucket,
      expected_artifact_prefix,
      expected_tags,
  ):
      client = sagemaker_session.sagemaker_client
      job_name = "my-train-job"
      rv = Mock()
      rv.source_arn = f"arn:1234/{job_name}"
      rv.environment_type = (
          _environment._EnvironmentType.SageMakerTrainingJob
      )
      mock_run_env.load.return_value = rv
  
      expected_tc_name = f"{TEST_EXP_NAME}{DELIMITER}{TEST_RUN_NAME}"
      exp_config = {
          EXPERIMENT_NAME: TEST_EXP_NAME,
          TRIAL_NAME: Run._generate_trial_name(TEST_EXP_NAME),
          RUN_NAME: expected_tc_name,
      }
      client.describe_training_job.return_value = {
          "TrainingJobName": "train-job-experiments",
          # The Run object has been created else where
          "ExperimentConfig": exp_config,
      }
      sagemaker_session.sagemaker_client.search.return_value = {
          "Results": [
              {
                  "TrialComponent": {
                      "Parents": [
                          {
                              "ExperimentName": TEST_EXP_NAME,
                              "TrialName": exp_config[TRIAL_NAME],
                          }
                      ],
                      "TrialComponentName": expected_tc_name,
                  }
              }
          ]
      }
      expmock = MagicMock(
          return_value=Experiment(
              experiment_name=TEST_EXP_NAME, tags=expected_tags
          )
      )
      with patch(
          "sagemaker.experiments.run.Experiment._load_or_create",
          expmock,
      ):
          with load_run(
              sagemaker_session=sagemaker_session, **kwargs
          ) as run_obj:
              assert run_obj._in_load
              assert not run_obj._inside_init_context
              assert run_obj._inside_load_context
              assert run_obj.run_name == TEST_RUN_NAME
              assert (
                  run_obj._trial_component.trial_component_name
                  == expected_tc_name
              )
              assert run_obj.run_group_name == Run._generate_trial_name(
                  TEST_EXP_NAME
              )
              assert run_obj._trial
              assert run_obj.experiment_name == TEST_EXP_NAME
              assert run_obj._experiment
              assert run_obj.experiment_config == exp_config
              assert (
                  run_obj._artifact_uploader.artifact_bucket
                  == expected_artifact_bucket
              )
              assert (
                  run_obj._artifact_uploader.artifact_prefix
                  == expected_artifact_prefix
              )
              assert run_obj._experiment.tags == expected_tags
  
      client.describe_training_job.assert_called_once_with(
          TrainingJobName=job_name
      )
      run_obj._trial.add_trial_component.assert_not_called()
  
imports: from __future__ import absolute_import
  import datetime
  import unittest
  import cloudpickle
  from math import inf, nan
  from unittest.mock import patch, Mock, MagicMock
  import dateutil
  import pytest
  from sagemaker.experiments import _environment, SortOrderType
  from sagemaker.experiments._api_types import TrialComponentArtifact, TrialComponentSummary, TrialComponentStatus, _TrialComponentStatusType, TrialComponentSearchResult
  from sagemaker.experiments.experiment import Experiment
  from sagemaker.experiments.run import TRIAL_NAME_TEMPLATE, MAX_RUN_TC_ARTIFACTS_LEN, MAX_NAME_LEN_IN_BACKEND, EXPERIMENT_NAME, RUN_NAME, TRIAL_NAME, DELIMITER, RUN_TC_TAG, SortByType
  from sagemaker.experiments import Run, load_run, list_runs
  from sagemaker.experiments.trial import _Trial
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.experiments._helper import _DEFAULT_ARTIFACT_PREFIX
  from tests.unit.sagemaker.experiments.helpers import mock_trial_load_or_create_func, mock_tc_load_or_create_func, TEST_EXP_NAME, TEST_EXP_NAME_MIXED_CASE, TEST_RUN_NAME, TEST_EXP_DISPLAY_NAME, TEST_RUN_DISPLAY_NAME, TEST_ARTIFACT_BUCKET, TEST_ARTIFACT_PREFIX, TEST_TAGS
label_desc: Use image node_id 3 for calling a global function with example usage: test_run_load_no_run_name_and_in_train_job(mock_run_env, sagemaker_session, kwargs, expected_artifact_bucket, expected_artifact_prefix, expected_tags) without return types