code: def log_model(
      sktime_model,
      artifact_path,
      conda_env=None,
      code_paths=None,
      registered_model_name=None,
      signature=None,
      input_example=None,
      await_registration_for=DEFAULT_AWAIT_MAX_SLEEP_SECONDS,
      pip_requirements=None,
      extra_pip_requirements=None,
      serialization_format=SERIALIZATION_FORMAT_PICKLE,
      **kwargs,
  ):
      """
      Log a ``sktime`` model as an MLflow artifact for the current run.
  
      Parameters
      ----------
      sktime_model : fitted ``sktime`` model
          Fitted ``sktime`` model object.
      artifact_path : str
          Run-relative artifact path to save the model to.
      conda_env : Union[dict, str], optional (default=None)
          Either a dictionary representation of a Conda environment or the path to a
          conda environment yaml file.
      code_paths : array-like, optional (default=None)
          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 : str, optional (default=None)
          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 : mlflow.models.signature.ModelSignature, optional (default=None)
          Model Signature mlflow.models.ModelSignature describes
          model input and output :py:class:`Schema <mlflow.types.Schema>`. The model
          signature can be :py:func:`inferred <mlflow.models.infer_signature>` from
          datasets with valid model input (e.g. the training dataset with target column
          omitted) and valid model output (e.g. model predictions generated on the
          training dataset), for example:
  
          .. code-block:: py
  
            from mlflow.models import infer_signature
  
            train = df.drop_column("target_label")
            predictions = ...  # compute model predictions
            signature = infer_signature(train, predictions)
  
          .. Warning:: if performing probabilistic forecasts (``predict_interval``,
            ``predict_quantiles``) with a ``sktime`` model, the signature
            on the returned prediction object will not be correctly inferred due
            to the Pandas MultiIndex column type when using the these methods.
            ``infer_schema`` will function correctly if using the ``pyfunc`` flavor
            of the model, though.
      input_example : Union[pandas.core.frame.DataFrame, numpy.ndarray, dict, list, csr_matrix, csc_matrix], optional (default=None)
          Input example provides one or several instances of valid model input.
          The example can be used as a hint of what data to feed the model. The given
          example will be converted to a ``Pandas DataFrame`` and then serialized to json
          using the ``Pandas`` split-oriented format. Bytes are base64-encoded.
      await_registration_for : int, optional (default=None)
          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 : Union[Iterable, str], optional (default=None)
          Either an iterable of pip requirement strings
          (e.g. ["sktime", "-r requirements.txt", "-c constraints.txt"]) or the string
          path to a pip requirements file on the local filesystem
          (e.g. "requirements.txt")
      extra_pip_requirements : Union[Iterable, str], optional (default=None)
          Either an iterable of pip requirement strings
          (e.g. ["pandas", "-r requirements.txt", "-c constraints.txt"]) or the string
          path to a pip requirements file on the local filesystem
          (e.g. "requirements.txt")
      serialization_format : str, optional (default="pickle")
          The format in which to serialize the model. This should be one of the formats
          "pickle" or "cloudpickle"
      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.
      """
      return Model.log(
          artifact_path=artifact_path,
          flavor=flavor,
          registered_model_name=registered_model_name,
          sktime_model=sktime_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,
          serialization_format=serialization_format,
          **kwargs,
      )
  
imports: import logging
  import os
  import pickle
  from typing import Any, Dict, Optional
  import flavor
  import numpy
  import pandas
  import sktime
  import yaml
  from sktime.utils.multiindex import flatten_multiindex
  import mlflow
  from mlflow import pyfunc
  from mlflow.exceptions import MlflowException
  from mlflow.models import Model
  from mlflow.models.model import MLMODEL_FILE_NAME
  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.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 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(sktime_model, artifact_path, conda_env, code_paths, registered_model_name, signature, input_example, await_registration_for, pip_requirements, extra_pip_requirements, serialization_format) and returns: Model