code: def save_matrix(vectors: np.ndarray, filename: str):
      """Write *.ibin, *.bbib, *.hbin, *.fbin, *.dbin files with matrices.
  
      :param vectors: the matrix to serialize
      :type vectors: numpy.ndarray
      :param filename: path to the matrix file
      :type filename: str
      """
      if filename.endswith(".fbin"):
          dtype = np.float32
      elif filename.endswith(".dbin"):
          dtype = np.float64
      elif filename.endswith(".hbin"):
          dtype = np.float16
      elif filename.endswith(".ibin"):
          dtype = np.int32
      elif filename.endswith(".bbin"):
          dtype = np.uint8
      else:
          dtype = vectors.dtype
  
      assert (
          len(vectors.shape) == 2
      ), "Input array must have 2 dimensions"
      with open(filename, "wb") as f:
          count, dim = vectors.shape
          f.write(struct.pack("<i", count))
          f.write(struct.pack("<i", dim))
          vectors.astype(dtype).flatten().tofile(f)
  
file_path: usearch/python/usearch/io.py
imports: import os
  import struct
  import typing
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: save_matrix(vectors, filename) without return types