code: def test_debug_hook_disabled_with_checkpointing(
      sagemaker_session,
      mxnet_training_latest_version,
      mxnet_training_latest_py_version,
      cpu_instance_type,
  ):
      with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
          s3_output_path = os.path.join(
              "s3://",
              sagemaker_session.default_bucket(),
              str(uuid.uuid4()),
          )
          debugger_hook_config = DebuggerHookConfig(
              s3_output_path=os.path.join(s3_output_path, "tensors")
          )
  
          script_path = os.path.join(
              DATA_DIR, "mxnet_mnist", "mnist_gluon.py"
          )
  
          # Estimator with checkpointing enabled
          mx = MXNet(
              entry_point=script_path,
              role="SageMakerRole",
              framework_version=mxnet_training_latest_version,
              py_version=mxnet_training_latest_py_version,
              instance_count=1,
              instance_type=cpu_instance_type,
              sagemaker_session=sagemaker_session,
              debugger_hook_config=debugger_hook_config,
              checkpoint_local_path="/opt/ml/checkpoints",
              checkpoint_s3_uri=os.path.join(
                  s3_output_path, "checkpoints"
              ),
          )
          mx._prepare_for_training()
  
          # Debug Hook should be enabled
          assert mx.debugger_hook_config is not None
  
          # Estimator with checkpointing enabled and Instance Count>1
          mx = MXNet(
              entry_point=script_path,
              role="SageMakerRole",
              framework_version=mxnet_training_latest_version,
              py_version=mxnet_training_latest_py_version,
              instance_count=2,
              instance_type=cpu_instance_type,
              sagemaker_session=sagemaker_session,
              debugger_hook_config=debugger_hook_config,
              checkpoint_local_path="/opt/ml/checkpoints",
              checkpoint_s3_uri=os.path.join(
                  s3_output_path, "checkpoints"
              ),
          )
          mx._prepare_for_training()
          # Debug Hook should be disabled
          assert mx.debugger_hook_config is False
  
          # Estimator with checkpointing enabled and SMDataParallel Enabled
          pt = PyTorch(
              base_job_name="pytorch-smdataparallel-mnist",
              entry_point=script_path,
              role="SageMakerRole",
              framework_version="1.8.0",
              py_version="py36",
              instance_count=1,
              # For training with p3dn instance use - ml.p3dn.24xlarge, with p4dn instance use - ml.p4d.24xlarge
              instance_type="ml.p3.16xlarge",
              sagemaker_session=sagemaker_session,
              # Training using SMDataParallel Distributed Training Framework
              distribution={
                  "smdistributed": {"dataparallel": {"enabled": True}}
              },
              checkpoint_local_path="/opt/ml/checkpoints",
              checkpoint_s3_uri=os.path.join(
                  s3_output_path, "checkpoints"
              ),
          )
          pt._prepare_for_training()
          # Debug Hook should be disabled
          assert pt.debugger_hook_config is False
  
          # Estimator with checkpointing enabled and SMModelParallel Enabled
          tf = TensorFlow(
              base_job_name="tf-smdataparallel-mnist",
              entry_point=script_path,
              role="SageMakerRole",
              framework_version="2.4.1",
              py_version="py36",
              instance_count=1,
              # For training with p3dn instance use - ml.p3dn.24xlarge, with p4dn instance use - ml.p4d.24xlarge
              instance_type="ml.p3.16xlarge",
              sagemaker_session=sagemaker_session,
              # Training using SMDataParallel Distributed Training Framework
              distribution={
                  "smdistributed": {"modelparallel": {"enabled": True}}
              },
              checkpoint_local_path="/opt/ml/checkpoints",
              checkpoint_s3_uri=os.path.join(
                  s3_output_path, "checkpoints"
              ),
          )
          tf._prepare_for_training()
          # Debug Hook should be disabled
          assert tf.debugger_hook_config is False
  
          # Estimator with checkpointing enabled with Xgboost Estimator
          xg = XGBoost(
              base_job_name="test_xgboost",
              entry_point=script_path,
              role="SageMakerRole",
              framework_version="1.2-1",
              py_version="py3",
              instance_count=2,
              # For training with p3dn instance use - ml.p3dn.24xlarge, with p4dn instance use - ml.p4d.24xlarge
              instance_type="ml.p3.16xlarge",
              sagemaker_session=sagemaker_session,
              # Training using SMDataParallel Distributed Training Framework
          )
          xg._prepare_for_training()
          # Debug Hook should be enabled
          assert xg.debugger_hook_config is not None
  
imports: from __future__ import absolute_import
  import os
  import uuid
  import pytest
  from sagemaker.debugger.debugger import DebuggerHookConfig, Rule, rule_configs, TensorBoardOutputConfig
  from sagemaker.mxnet.estimator import MXNet
  from sagemaker.pytorch.estimator import PyTorch
  from sagemaker.tensorflow.estimator import TensorFlow
  from sagemaker.xgboost.estimator import XGBoost
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.retry import retries
  from tests.integ.timeout import timeout
label_desc: Use image node_id 7 for calling a global function with example usage: test_debug_hook_disabled_with_checkpointing(sagemaker_session, mxnet_training_latest_version, mxnet_training_latest_py_version, cpu_instance_type) without return types