code: def _test_model_log(statsmodels_model, model_path, *predict_args):
      model = statsmodels_model.model
      with TempDir(chdr=True, remove_on_exit=True) as tmp:
          try:
              artifact_path = "model"
              conda_env = os.path.join(tmp.path(), "conda_env.yaml")
              _mlflow_conda_env(
                  conda_env, additional_pip_deps=["statsmodels"]
              )
  
              model_info = mlflow.statsmodels.log_model(
                  statsmodels_model=model,
                  artifact_path=artifact_path,
                  conda_env=conda_env,
              )
              model_uri = f"runs:/{mlflow.active_run().info.run_id}/{artifact_path}"
              assert model_info.model_uri == model_uri
  
              reloaded_model = mlflow.statsmodels.load_model(
                  model_uri=model_uri
              )
              if hasattr(model, "predict"):
                  np.testing.assert_array_almost_equal(
                      model.predict(*predict_args),
                      reloaded_model.predict(*predict_args),
                  )
  
              model_path = _download_artifact_from_uri(
                  artifact_uri=model_uri
              )
              model_config = Model.load(
                  os.path.join(model_path, "MLmodel")
              )
              assert pyfunc.FLAVOR_NAME in model_config.flavors
              assert (
                  pyfunc.ENV in model_config.flavors[pyfunc.FLAVOR_NAME]
              )
              env_path = model_config.flavors[pyfunc.FLAVOR_NAME][
                  pyfunc.ENV
              ]["conda"]
              assert os.path.exists(os.path.join(model_path, env_path))
          finally:
              mlflow.end_run()
  
imports: import json
  import os
  from pathlib import Path
  from unittest import mock
  import numpy
  import pandas
  import pytest
  import yaml
  import mlflow.pyfunc.scoring_server
  import mlflow.statsmodels
  import mlflow.utils
  from mlflow import pyfunc
  from mlflow.models import Model
  from mlflow.models.utils import _read_example
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils.environment import _mlflow_conda_env
  from mlflow.utils.file_utils import TempDir
  from mlflow.utils.model_utils import _get_flavor_configuration
  from tests.helper_functions import _assert_pip_requirements, _compare_conda_env_requirements, _compare_logged_code_paths, _is_available_on_pypi, _mlflow_major_version_string, assert_register_model_called_with_local_model_path, pyfunc_serve_and_score_model
  from tests.statsmodels.model_fixtures import arma_model, gee_model, glm_model, gls_model, glsar_model, ols_model, ols_model_signature, recursivels_model, rolling_ols_model, rolling_wls_model, wls_model
label_desc: Use image node_id 6 for calling a global function with example usage: _test_model_log(statsmodels_model, model_path) without return types