code: def _create_and_fit_estimator(
      mxnet_version,
      py_version,
      sagemaker_session,
      instance_type,
      tmpdir,
  ):
      job_name = sagemaker.utils.unique_name_from_base("mx-horovod")
      estimator = MXNet(
          entry_point=os.path.join(horovod_dir, "hvd_mnist_mxnet.py"),
          role="SageMakerRole",
          instance_count=2,
          instance_type=instance_type,
          sagemaker_session=sagemaker_session,
          py_version=py_version,
          framework_version=mxnet_version,
          distribution={"mpi": {"enabled": True}},
          disable_profiler=True,
      )
  
      with timeout.timeout(
          minutes=integ.TRAINING_DEFAULT_TIMEOUT_MINUTES
      ):
          estimator.fit(job_name=job_name)
  
          tmp = str(tmpdir)
          extract_files_from_s3(
              estimator.model_data, tmp, sagemaker_session
          )
  
          for rank in range(2):
              assert read_json("rank-%s" % rank, tmp)["rank"] == rank
  
file_path: sagemaker-python-sdk/tests/integ/test_horovod_mx.py
imports: from __future__ import absolute_import
  import json
  import os
  import pytest
  import sagemaker.utils
  import tests.integ
  from tests.integ.s3_utils import extract_files_from_s3
  from sagemaker.mxnet import MXNet
  from tests.integ import timeout
  from tests.integ.utils import gpu_list, retry_with_instance_list
label_desc: Use image node_id 4 for calling a global function with example usage: _create_and_fit_estimator(mxnet_version, py_version, sagemaker_session, instance_type, tmpdir) without return types