code: def clean_bentoml_version(bentoml_version: str) -> str:
      post_version = bentoml_version.split("+")[0]
      match = re.match(
          r"^(\d+)\.(\d+)\.(\d+)(?:(a|rc)\d)*", post_version
      )
      if match is None:
          raise BentoMLException(
              "Errors while parsing BentoML version."
          )
      return match.group()
  
imports: from __future__ import annotations
  import importlib.metadata
  import logging
  import os
  import re
  import typing
  from functools import lru_cache
  from ...exceptions import BentoMLConfigException
  from ...exceptions import BentoMLException
label_desc: Use image node_id 2 for calling a global function with example usage: clean_bentoml_version(bentoml_version) and returns: match