code: def test_nested_run_init_context_on_different_run_object(
      run_obj, sagemaker_session
  ):
      assert not _RunContext.get_current_run()
  
      with pytest.raises(RuntimeError) as err:
          with Run(
              experiment_name=TEST_EXP_NAME,
              sagemaker_session=sagemaker_session,
          ):
              assert _RunContext.get_current_run()
  
              with run_obj:
                  pass
      assert (
          "It is not allowed to use nested 'with' statements on the Run"
          in str(err)
      )
  
      with pytest.raises(RuntimeError) as err:
          with Run(
              experiment_name=TEST_EXP_NAME,
              sagemaker_session=sagemaker_session,
          ):
              assert _RunContext.get_current_run()
  
              with Run(
                  experiment_name=TEST_EXP_NAME,
                  sagemaker_session=sagemaker_session,
              ):
                  pass
      assert (
          "It is not allowed to use nested 'with' statements on the Run"
          in str(err)
      )
  
imports: from __future__ import absolute_import
  from unittest.mock import patch, MagicMock
  import pytest
  from sagemaker import Processor
  from sagemaker.estimator import Estimator, _TrainingJob
  from sagemaker.experiments.experiment import Experiment
  from sagemaker.experiments.run import _RunContext
  from sagemaker.experiments import load_run, Run
  from sagemaker.experiments.trial import _Trial
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.processing import ProcessingJob
  from sagemaker.transformer import _TransformJob, Transformer
  from tests.unit.sagemaker.experiments.helpers import TEST_EXP_NAME, mock_trial_load_or_create_func, mock_tc_load_or_create_func
label_desc: Use image node_id 8 for calling a global function with example usage: test_nested_run_init_context_on_different_run_object(run_obj, sagemaker_session) without return types