code: def log_model(
      pmdarima_model,
      artifact_path,
      conda_env=None,
      code_paths=None,
      registered_model_name=None,
      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,
  ):
      """
      Logs a ``pmdarima`` ``ARIMA`` or ``Pipeline`` object as an MLflow artifact for the current run.
  
      Args:
          pmdarima_model: pmdarima ``ARIMA`` or ``Pipeline`` model that has been ``fit`` on a
              temporal series.
          artifact_path: Run-relative artifact path to save the model instance to.
          conda_env: {{ conda_env }}
          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.
          registered_model_name: This argument may change or be removed in a
              future release without warning. If given, create a model
              version under ``registered_model_name``, also creating a
              registered model if one with the given name does not exist.
          signature: an instance of the :py:class:`ModelSignature <mlflow.models.ModelSignature>`
              class that describes the model's inputs and outputs. If not specified but an
              ``input_example`` is supplied, a signature will be automatically inferred
              based on the supplied input example and model. To disable automatic signature
              inference when providing an input example, set ``signature`` to ``False``.
              To manually infer a model signature, call
              :py:func:`infer_signature() <mlflow.models.infer_signature>` on datasets
              with valid model inputs, such as a training dataset with the target column
              omitted, and valid model outputs, like model predictions made on the training
              dataset, for example:
  
              .. code-block:: python
  
                  from mlflow.models import infer_signature
  
                  model = pmdarima.auto_arima(data)
                  predictions = model.predict(n_periods=30, return_conf_int=False)
                  signature = infer_signature(data, predictions)
  
              .. Warning:: if utilizing confidence interval generation in the ``predict``
                  method of a ``pmdarima`` model (``return_conf_int=True``), the signature
                  will not be inferred due to the complex tuple return type when using the
                  native ``ARIMA.predict()`` API. ``infer_schema`` will function correctly
                  if using the ``pyfunc`` flavor of the model, though.
  
          input_example: {{ input_example }}
          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.
          pip_requirements: {{ pip_requirements }}
          extra_pip_requirements: {{ extra_pip_requirements }}
          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.
          kwargs: Additional arguments for :py:class:`mlflow.models.model.Model`
  
      Returns:
          A :py:class:`ModelInfo <mlflow.models.model.ModelInfo>` instance that contains the
          metadata of the logged model.
  
      .. code-block:: python
          :caption: Example
  
          import pandas as pd
          import mlflow
          from mlflow.models import infer_signature
          import pmdarima
          from pmdarima.metrics import smape
  
          # Specify locations of source data and the model artifact
          SOURCE_DATA = "https://raw.githubusercontent.com/facebook/prophet/master/examples/example_retail_sales.csv"
          ARTIFACT_PATH = "model"
  
          # Read data and recode columns
          sales_data = pd.read_csv(SOURCE_DATA)
          sales_data.rename(columns={"y": "sales", "ds": "date"}, inplace=True)
  
          # Split the data into train/test
          train_size = int(0.8 * len(sales_data))
          train, test = sales_data[:train_size], sales_data[train_size:]
  
          with mlflow.start_run():
              # Create the model
              model = pmdarima.auto_arima(train["sales"], seasonal=True, m=12)
  
              # Calculate metrics
              prediction = model.predict(n_periods=len(test))
              metrics = {"smape": smape(test["sales"], prediction)}
  
              # Infer signature
              input_sample = pd.DataFrame(train["sales"])
              output_sample = pd.DataFrame(model.predict(n_periods=5))
              signature = infer_signature(input_sample, output_sample)
  
              # Log model
              mlflow.pmdarima.log_model(model, ARTIFACT_PATH, signature=signature)
      """
  
      return Model.log(
          artifact_path=artifact_path,
          flavor=mlflow.pmdarima,
          registered_model_name=registered_model_name,
          pmdarima_model=pmdarima_model,
          conda_env=conda_env,
          code_paths=code_paths,
          signature=signature,
          input_example=input_example,
          await_registration_for=await_registration_for,
          pip_requirements=pip_requirements,
          extra_pip_requirements=extra_pip_requirements,
          metadata=metadata,
          **kwargs,
      )
  
imports: import logging
  import os
  import pickle
  import warnings
  from typing import Any, Dict, Optional
  import pandas
  import yaml
  from packaging.version import Version
  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.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.tracking._model_registry import DEFAULT_AWAIT_MAX_SLEEP_SECONDS
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  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
label_desc: Use image node_id 4 for calling a global function with example usage: log_model(pmdarima_model, artifact_path, conda_env, code_paths, registered_model_name, signature, input_example, await_registration_for, pip_requirements, extra_pip_requirements, metadata) and returns: Model