code: def validate_container_tag(
      ctx: Context, param: Parameter, tag: str | tuple[str] | None
  ) -> str | tuple[str] | None:
      from bentoml.exceptions import BentoMLException
  
      if not tag:
          return tag
      elif isinstance(tag, tuple):
          return tuple(map(_validate_docker_tag, tag))
      elif isinstance(tag, str):
          return _validate_docker_tag(tag)
      else:
          raise BentoMLException(f"Invalid tag type. Got {type(tag)}")
  
imports: from __future__ import annotations
  import difflib
  import functools
  import logging
  import os
  import re
  import time
  import typing
  import attr
  import click
  import click_option_group
  from click import ClickException
  from click.exceptions import UsageError
label_desc: Use image node_id 3 for calling a global function with example usage: validate_container_tag(ctx, param, tag) and returns: tag, tuple, _validate_docker_tag