code: def log_model(
      pd_model,
      artifact_path,
      training=False,
      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,
  ):
      """
      Log a paddle model as an MLflow artifact for the current run. Produces an MLflow Model
      containing the following flavors:
  
          - :py:mod:`mlflow.paddle`
          - :py:mod:`mlflow.pyfunc`. NOTE: This flavor is only included for paddle models
            that define `predict()`, since `predict()` is required for pyfunc model inference.
  
      Args:
          pd_model: paddle model to be saved.
          artifact_path: Run-relative artifact path.
          training: Only valid when saving a model trained using the PaddlePaddle high level API.
              If set to True, the saved model supports both re-training and
              inference. If set to False, it only supports inference.
          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: 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: {{ signature }}
          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.
  
      Returns:
          A :py:class:`ModelInfo <mlflow.models.model.ModelInfo>` instance that contains the
          metadata of the logged model.
  
      .. code-block:: python
          :caption: Example
  
          import mlflow.paddle
  
  
          def load_data():
              ...
  
  
          class Regressor:
              ...
  
  
          model = Regressor()
          model.train()
          training_data, test_data = load_data()
          opt = paddle.optimizer.SGD(learning_rate=0.01, parameters=model.parameters())
          EPOCH_NUM = 10
          BATCH_SIZE = 10
          for epoch_id in range(EPOCH_NUM):
              ...
          mlflow.log_param("learning_rate", 0.01)
          mlflow.paddle.log_model(model, "model")
          sk_path_dir = ...
          mlflow.paddle.save_model(model, sk_path_dir)
      """
      return Model.log(
          artifact_path=artifact_path,
          flavor=mlflow.paddle,
          pd_model=pd_model,
          conda_env=conda_env,
          code_paths=code_paths,
          registered_model_name=registered_model_name,
          signature=signature,
          input_example=input_example,
          await_registration_for=await_registration_for,
          training=training,
          pip_requirements=pip_requirements,
          extra_pip_requirements=extra_pip_requirements,
          metadata=metadata,
      )
  
imports: import logging
  import os
  from typing import Any, Dict, Optional
  import yaml
  import mlflow
  from mlflow import pyfunc
  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, 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 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 5 for calling a global function with example usage: log_model(pd_model, artifact_path, training, conda_env, code_paths, registered_model_name, signature, input_example, await_registration_for, pip_requirements, extra_pip_requirements, metadata) and returns: Model