code: def ext_serializable(cls, type_code: int):
      assert isinstance(
          type_code, int
      ), "Please specify a (unique) int type code"
  
      def wrap(wrapped_type: type):
          assert callable(
              getattr(wrapped_type, "packb", None)
          ) and callable(
              getattr(wrapped_type, "unpackb", None)
          ), f"Every ext_type must have 2 methods: packb(self) -> bytes and classmethod unpackb(cls, bytes)"
          if type_code in cls._ext_type_codes:
              logger.warning(
                  f"{cls.__name__}: type {type_code} is already registered, overwriting"
              )
          (
              cls._ext_type_codes[type_code],
              cls._ext_types[wrapped_type],
          ) = (wrapped_type, type_code)
          return wrapped_type
  
      return wrap
  
file_path: hivemind/hivemind/utils/serializer.py
imports: from abc import ABC, abstractmethod
  from typing import Any, Dict
  import msgpack
  from hivemind.utils.logging import get_logger
label_desc: Use image node_id 1 for calling the MSGPackSerializer obj's underlying member method code with example usage: obj.ext_serializable(cls, type_code) and returns: wrap, wrapped_type