code: def convert_python(cls, v, values) -> Optional[PythonVersion]:
      if v is not None and values.get("image"):
          raise KeyError(
              "`image` and `python` are mutually exclusive fields"
          )
      if isinstance(v, float):
          v = str(v)
          if v == "3.1":
              v = "3.10"
      if isinstance(v, str):
          return PythonVersion(v)
      return v
  
imports: import re
  from enum import Enum
  from typing import Dict, List, Optional, Union
  from pydantic import BaseModel, Field, ValidationError, conint, constr, validator
  from typing_extensions import Annotated, Literal
  from dstack._internal.core.errors import ConfigurationError
  from dstack._internal.core.models.common import ForbidExtra
  from dstack._internal.core.models.repos.base import Repo
  from dstack._internal.core.models.repos.virtual import VirtualRepo
label_desc: Use image node_id 1 for calling the BaseConfiguration obj's underlying member method code with example usage: obj.convert_python(cls, v, values) and returns: v, PythonVersion