class_docstr: Serializer that uses a tag system to compactly represent objects that
  are not JSON types. Passed as the intermediate serializer to
  :class:`itsdangerous.Serializer`.
  
  The following extra types are supported:
  
  * :class:`dict`
  * :class:`tuple`
  * :class:`bytes`
  * :class:`~markupsafe.Markup`
  * :class:`~uuid.UUID`
  * :class:`~datetime.datetime`
class_docstr_tok: ["Serializer","that","uses","a","tag","system","to","compactly","represent","objects","that","are","not","JSON","types",".","Passed","as","the","intermediate","serializer","to",":","class",":","`","itsdangerous.Serializer","`",".","The","following","extra","types","are","supported",":","*",":","class",":","`","dict","`","*",":","class",":","`","tuple","`","*",":","class",":","`","bytes","`","*",":","class",":","`","~markupsafe.Markup","`","*",":","class",":","`","~uuid.UUID","`","*",":","class",":","`","~datetime.datetime","`"]
docstr: Register a new tag with this serializer.
  
  :param tag_class: tag class to register. Will be instantiated with this
      serializer instance.
  :param force: overwrite an existing tag. If false (default), a
      :exc:`KeyError` is raised.
  :param index: index to insert the new tag in the tag order. Useful when
      the new tag is a special case of an existing tag. If ``None``
      (default), the tag is appended to the end of the order.
  
  :raise KeyError: if the tag key is already registered and ``force`` is
      not true.
code: def register(
      self,
      tag_class: type[JSONTag],
      force: bool = False,
      index: int | None = None,
  ) -> None:
      """Register a new tag with this serializer.
  
      :param tag_class: tag class to register. Will be instantiated with this
          serializer instance.
      :param force: overwrite an existing tag. If false (default), a
          :exc:`KeyError` is raised.
      :param index: index to insert the new tag in the tag order. Useful when
          the new tag is a special case of an existing tag. If ``None``
          (default), the tag is appended to the end of the order.
  
      :raise KeyError: if the tag key is already registered and ``force`` is
          not true.
      """
      tag = tag_class(self)
      key = tag.key
  
      if key is not None:
          if not force and key in self.tags:
              raise KeyError(f"Tag '{key}' is already registered.")
  
          self.tags[key] = tag
  
      if index is None:
          self.order.append(tag)
      else:
          self.order.insert(index, tag)
  
imports: from __future__ import annotations
  import typing
  from base64 import b64decode
  from base64 import b64encode
  from datetime import datetime
  from uuid import UUID
  from markupsafe import Markup
  from werkzeug.http import http_date
  from werkzeug.http import parse_date
  from ..json import dumps
  from ..json import loads
label_desc: Use image node_id 2 for calling the TaggedJSONSerializer obj's underlying member method code with example usage: obj.register(tag_class, force, index) without return types