code: def xbin_mmap(fname, dtype, maxn=-1):
      """
      Code from
      https://github.com/harsha-simhadri/big-ann-benchmarks/blob/main/benchmark/dataset_io.py#L94
      mmap the competition file format for a given type of items
      """
      n, d = map(int, np.fromfile(fname, dtype="uint32", count=2))
      assert (
          os.stat(fname).st_size == 8 + n * d * np.dtype(dtype).itemsize
      )
      if maxn > 0:
          n = min(n, maxn)
      return np.memmap(
          fname, dtype=dtype, mode="r", offset=8, shape=(n, d)
      )
  
imports: import numpy
  import argparse
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: xbin_mmap(fname, dtype, maxn) and returns: np