code: def _encode_ext_types(cls, obj):
      type_code = cls._ext_types.get(type(obj))
      if type_code is not None:
          return msgpack.ExtType(type_code, obj.packb())
      elif isinstance(obj, tuple):
          # Tuples need to be handled separately to ensure that
          # 1. tuple serialization works and 2. tuples serialized not as lists
          data = msgpack.packb(
              list(obj),
              strict_types=True,
              use_bin_type=True,
              default=cls._encode_ext_types,
          )
          return msgpack.ExtType(cls._TUPLE_EXT_TYPE_CODE, data)
      return obj
  
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 2 for calling the MSGPackSerializer obj's underlying member method code with example usage: obj._encode_ext_types(cls, obj) and returns: obj, msgpack, msgpack