code: def to_mlflow_entity(self):
      # SqlRegisteredModel has backref to all "model_versions". Filter latest for each stage.
      latest_versions = {}
      for mv in self.model_versions:
          stage = mv.current_stage
          if stage != STAGE_DELETED_INTERNAL and (
              stage not in latest_versions
              or latest_versions[stage].version < mv.version
          ):
              latest_versions[stage] = mv
      return RegisteredModel(
          self.name,
          self.creation_time,
          self.last_updated_time,
          self.description,
          [mvd.to_mlflow_entity() for mvd in latest_versions.values()],
          [
              tag.to_mlflow_entity()
              for tag in self.registered_model_tags
          ],
          [
              alias.to_mlflow_entity()
              for alias in self.registered_model_aliases
          ],
      )
  
imports: from sqlalchemy import BigInteger, Column, ForeignKey, ForeignKeyConstraint, Integer, PrimaryKeyConstraint, String
  from sqlalchemy.orm import backref, relationship
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag, RegisteredModel, RegisteredModelAlias, RegisteredModelTag
  from mlflow.entities.model_registry.model_version_stages import STAGE_DELETED_INTERNAL, STAGE_NONE
  from mlflow.entities.model_registry.model_version_status import ModelVersionStatus
  from mlflow.store.db.base_sql_model import Base
  from mlflow.utils.time import get_current_time_millis
label_desc: Use image node_id 2 for calling the SqlRegisteredModel obj's underlying member method code with example usage: obj.to_mlflow_entity() and returns: RegisteredModel