code: def _parse_tag_from_outputs(output: bytes) -> str:
      matched = re.search(
          r"^__tag__:([^:\n]+:[^:\n]+)$",
          output.decode("utf-8").strip(),
          flags=re.MULTILINE,
      )
      if matched is None:
          raise BentoMLException(
              f"Failed to find tag from output: {output}\nNote: Output from 'bentoml build' might not be correct. Please open an issue on GitHub."
          )
      return matched.group(1)
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import subprocess
  import sys
  import tempfile
  import typing
  from simple_di import Provide
  from simple_di import inject
  from ._internal.bento import Bento
  from ._internal.bento.build_config import BentoBuildConfig
  from ._internal.configuration.containers import BentoMLContainer
  from ._internal.tag import Tag
  from ._internal.utils import resolve_user_filepath
  from .exceptions import BadInput
  from .exceptions import BentoMLException
  from .exceptions import InvalidArgument
label_desc: Use image node_id 9 for calling a global function with example usage: _parse_tag_from_outputs(output) and returns: matched