code: def validate_tag_str(value: str):
      """
      Validate that a tag value (either name or version) is a simple string that:
          * Must be at most 63 characters long,
          * Begin and end with an alphanumeric character (`[a-z0-9A-Z]`), and
          * May contain dashes (`-`), underscores (`_`) dots (`.`), or alphanumerics
            between.
      """
      errors: list[str] = []
      if len(value) > tag_max_length:
          errors.append(tag_max_length_error_msg)
      if tag_regex.match(value) is None:
          errors.append(tag_invalid_error_msg)
  
      if errors:
          # TODO: link to tag documentation
          raise ValueError(
              f"{value} is not a valid BentoML tag: "
              + ", and ".join(errors)
          )
  
imports: import base64
  import logging
  import re
  import typing
  import uuid
  import attr
  import fs
  from ..exceptions import BentoMLException
  from .utils import bentoml_cattr
label_desc: Use image node_id 1 for calling a global function with example usage: validate_tag_str(value) without return types