code: def log_model(
      statsmodels_model,
      artifact_path,
      conda_env=None,
      code_paths=None,
      registered_model_name=None,
      remove_data: bool = False,
      signature: ModelSignature = None,
      input_example: ModelInputExample = None,
      await_registration_for=DEFAULT_AWAIT_MAX_SLEEP_SECONDS,
      pip_requirements=None,
      extra_pip_requirements=None,
      metadata=None,
      **kwargs,
  ):
      """
      Log a statsmodels model as an MLflow artifact for the current run.
  
      :param statsmodels_model: statsmodels model (an instance of `statsmodels.base.model.Results`_)
                                to be saved.
      :param artifact_path: Run-relative artifact path.
      :param conda_env: {{ conda_env }}
      :param code_paths: A list of local filesystem paths to Python file dependencies (or directories
                         containing file dependencies). These files are *prepended* to the system
                         path when the model is loaded.
      :param registered_model_name: If given, create a model version under
                                    ``registered_model_name``, also creating a registered model if one
                                    with the given name does not exist.
  
      :param remove_data: bool. If False (default), then the instance is pickled without changes.
                          If True, then all arrays with length nobs are set to None before
                          pickling. See the remove_data method.
                          In some cases not all arrays will be set to None.
  
      :param signature: {{ signature }}
      :param input_example: {{ input_example }}
      :param await_registration_for: Number of seconds to wait for the model version to finish
                              being created and is in ``READY`` status. By default, the function
                              waits for five minutes. Specify 0 or None to skip waiting.
      :param pip_requirements: {{ pip_requirements }}
      :param extra_pip_requirements: {{ extra_pip_requirements }}
      :param metadata: Custom metadata dictionary passed to the model and stored in the MLmodel file.
  
                       .. Note:: Experimental: This parameter may change or be removed in a future
                                               release without warning.
      :return: A :py:class:`ModelInfo <mlflow.models.model.ModelInfo>` instance that contains the
               metadata of the logged model.
      """
      return Model.log(
          artifact_path=artifact_path,
          flavor=mlflow.statsmodels,
          registered_model_name=registered_model_name,
          statsmodels_model=statsmodels_model,
          conda_env=conda_env,
          code_paths=code_paths,
          signature=signature,
          input_example=input_example,
          await_registration_for=await_registration_for,
          remove_data=remove_data,
          pip_requirements=pip_requirements,
          extra_pip_requirements=extra_pip_requirements,
          metadata=metadata,
          **kwargs,
      )
  
imports: import inspect
  import itertools
  import logging
  import os
  from typing import Any, Dict, Optional
  import yaml
  import mlflow
  from mlflow import pyfunc
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model, ModelInputExample, ModelSignature
  from mlflow.models.model import MLMODEL_FILE_NAME
  from mlflow.models.signature import _infer_signature_from_input_example
  from mlflow.models.utils import _save_example
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils.autologging_utils import autologging_integration, get_autologging_config, log_fn_args_as_params, safe_patch
  from mlflow.utils.docstring_utils import LOG_MODEL_PARAM_DOCS, format_docstring
  from mlflow.utils.environment import _CONDA_ENV_FILE_NAME, _CONSTRAINTS_FILE_NAME, _PYTHON_ENV_FILE_NAME, _REQUIREMENTS_FILE_NAME, _mlflow_conda_env, _process_conda_env, _process_pip_requirements, _PythonEnv, _validate_env_arguments
  from mlflow.utils.file_utils import get_total_file_size, write_to
  from mlflow.utils.model_utils import _add_code_from_conf_to_system_path, _get_flavor_configuration, _validate_and_copy_code_paths, _validate_and_prepare_target_save_path
  from mlflow.utils.requirements_utils import _get_pinned_requirement
  from mlflow.utils.validation import _is_numeric
label_desc: Use image node_id 4 for calling a global function with example usage: log_model(statsmodels_model, artifact_path, conda_env, code_paths, registered_model_name, remove_data, signature, input_example, await_registration_for, pip_requirements, extra_pip_requirements, metadata) and returns: Model