class_docstr: Helper class to create a model with added dependency wheels from an existing registered model.
  The `wheeled` model contains all the model dependencies as wheels stored as model artifacts.
  .. note::
      This utility only operates on a model that has been registered to the Model Registry.
class_docstr_tok: ["Helper","class","to","create","a","model","with","added","dependency","wheels","from","an","existing","registered","model",".","The","`","wheeled","`","model","contains","all","the","model","dependencies","as","wheels","stored","as","model","artifacts",".","..","note",":",":","This","utility","only","operates","on","a","model","that","has","been","registered","to","the","Model","Registry","."]
docstr: Logs a registered model as an MLflow artifact for the current run. This only operates on
  a model which has been registered to the Model Registry. Given a registered model_uri (
  e.g. models:/<model_name>/<model_version>), this utility re-logs the model along with all
  the required model libraries back to the Model Registry. The required model libraries are
  stored along with the model as model artifacts. In addition, supporting files to the
  model (e.g. conda.yaml, requirements.txt) are modified to use the added libraries.
  
  By default, this utility creates a new model version under the same registered model
  specified by ``model_uri``. This behavior can be overridden by specifying the
  ``registered_model_name`` argument.
  
  :param model_uri: A registered model uri in the Model Registry of the form
                    models:/<model_name>/<model_version/stage/latest>
  :param registered_model_name: The new model version (model with its libraries) is
                                registered under the inputted registered_model_name. If None,
                                a new version is logged to the existing model in the Model
                                Registry.
  
  .. code-block:: python
      :caption: Example
  
      # Given a model uri, log the wheeled model
      with mlflow.start_run():
          WheeledModel.log_model(model_uri)
docstr_tok: ["Logs","a","registered","model","as","an","MLflow","artifact","for","the","current","run",".","This","only","operates","on","a","model","which","has","been","registered","to","the","Model","Registry",".","Given","a","registered","model_uri","(","e.g",".","models",":","\/","<","model_name",">","\/","<","model_version",">",")",",","this","utility","re-logs","the","model","along","with","all","the","required","model","libraries","back","to","the","Model","Registry",".","The","required","model","libraries","are","stored","along","with","the","model","as","model","artifacts",".","In","addition",",","supporting","files","to","the","model","(","e.g",".","conda.yaml",",","requirements.txt",")","are","modified","to","use","the","added","libraries",".","By","default",",","this","utility","creates","a","new","model","version","under","the","same","registered","model","specified","by","``","model_uri","``",".","This","behavior","can","be","overridden","by","specifying","the","``","registered_model_name","``","argument",".",":","param","model_uri",":","A","registered","model","uri","in","the","Model","Registry","of","the","form","models",":","\/","<","model_name",">","\/","<","model_version\/stage\/latest",">",":","param","registered_model_name",":","The","new","model","version","(","model","with","its","libraries",")","is","registered","under","the","inputted","registered_model_name",".","If","None",",","a","new","version","is","logged","to","the","existing","model","in","the","Model","Registry",".","..","code-block",":",":","python",":","caption",":","Example","#","Given","a","model","uri",",","log","the","wheeled","model","with","mlflow.start_run","(",")",":","WheeledModel.log_model","(","model_uri",")"]
code: def log_model(cls, model_uri, registered_model_name=None):
      """
      Logs a registered model as an MLflow artifact for the current run. This only operates on
      a model which has been registered to the Model Registry. Given a registered model_uri (
      e.g. models:/<model_name>/<model_version>), this utility re-logs the model along with all
      the required model libraries back to the Model Registry. The required model libraries are
      stored along with the model as model artifacts. In addition, supporting files to the
      model (e.g. conda.yaml, requirements.txt) are modified to use the added libraries.
  
      By default, this utility creates a new model version under the same registered model
      specified by ``model_uri``. This behavior can be overridden by specifying the
      ``registered_model_name`` argument.
  
      :param model_uri: A registered model uri in the Model Registry of the form
                        models:/<model_name>/<model_version/stage/latest>
      :param registered_model_name: The new model version (model with its libraries) is
                                    registered under the inputted registered_model_name. If None,
                                    a new version is logged to the existing model in the Model
                                    Registry.
  
      .. code-block:: python
          :caption: Example
  
          # Given a model uri, log the wheeled model
          with mlflow.start_run():
              WheeledModel.log_model(model_uri)
      """
      parsed_uri = _parse_model_uri(model_uri)
      return Model.log(
          artifact_path=None,
          flavor=WheeledModel(model_uri),
          registered_model_name=registered_model_name
          or parsed_uri.name,
      )
  
imports: import os
  import platform
  import shutil
  import subprocess
  import sys
  import yaml
  import mlflow
  from mlflow import MlflowClient
  from mlflow.environment_variables import MLFLOW_WHEELED_MODEL_PIP_DOWNLOAD_OPTIONS
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import BAD_REQUEST
  from mlflow.pyfunc.model import MLMODEL_FILE_NAME, Model
  from mlflow.store.artifact.utils.models import _parse_model_uri, get_model_name_and_version
  from mlflow.tracking.artifact_utils import _download_artifact_from_uri
  from mlflow.utils.annotations import experimental
  from mlflow.utils.environment import _REQUIREMENTS_FILE_NAME, _get_pip_deps, _mlflow_additional_pip_env, _overwrite_pip_deps
  from mlflow.utils.model_utils import _validate_and_prepare_target_save_path
  from mlflow.utils.uri import get_databricks_profile_uri_from_artifact_uri
label_desc: Use image node_id 2 for calling the WheeledModel obj's underlying member method code with example usage: obj.log_model(cls, model_uri, registered_model_name) and returns: Model