code: def pack_stream(tree: Iterator[Tuple[bytes, bytes]]) -> bytes:
      # TODO: [MV] check the performance diff of current version vs collecting the whole tree as a chunk
      for key, val in tree:
          if not isinstance(val, BLOB):
              yield struct.pack("I", len(key)) + key + struct.pack(
                  "?", False
              ) + struct.pack("I", len(val)) + val
          else:
              val = val.load()
              yield struct.pack("I", len(key)) + key + struct.pack(
                  "?", True
              ) + struct.pack("I", len(val)) + val
  
imports: import importlib
  import struct
  import json
  from typing import Iterator, Tuple, Union
  import aim.ext.transport.proto.remote_tracking_pb2
  from aim.storage.object import CustomObject
  from aim.storage.types import BLOB
label_desc: Use image node_id 3 for calling a global function with example usage: pack_stream(tree) without return types