code: def test_estimator_py2_warning(warning, sagemaker_session):
      estimator = MXNet(
          entry_point=SCRIPT_PATH,
          framework_version="1.2.1",
          py_version="py2",
          role=ROLE,
          sagemaker_session=sagemaker_session,
          instance_count=INSTANCE_COUNT,
          instance_type=INSTANCE_TYPE,
      )
  
      assert estimator.py_version == "py2"
      warning.assert_called_with(
          estimator._framework_name, defaults.LATEST_PY2_VERSION
      )
  
imports: from __future__ import absolute_import
  import logging
  import json
  import os
  import pytest
  from mock import MagicMock, Mock, ANY
  from mock import patch
  from pkg_resources import parse_version
  from sagemaker.fw_utils import UploadedCode
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.model_metrics import FileSource, MetricsSource, ModelMetrics
  from sagemaker.mxnet import defaults
  from sagemaker.mxnet import MXNet
  from sagemaker.mxnet import MXNetPredictor, MXNetModel
  from sagemaker.session_settings import SessionSettings
label_desc: Use image node_id 27 for calling a global function with example usage: test_estimator_py2_warning(warning, sagemaker_session) without return types