code: def write_nums(self, f, numbers):
      buf = emptybytes
      count = 0
      key = 0
      for v in numbers:
          shift = count * 2
          if v < 256:
              buf += pack_byte(v)
          elif v < 65536:
              key |= 1 << shift
              buf += pack_ushort_le(v)
          elif v < 16777216:
              key |= 2 << shift
              buf += pack_uint_le(v)[:3]
          else:
              key |= 3 << shift
              buf += pack_uint_le(v)
  
          count += 1
          if count == 4:
              f.write_byte(key)
              f.write(buf)
              count = 0
              key = 0
              buf = emptybytes  # Clear the buffer
  
      # Write out leftovers in the buffer
      if count:
          f.write_byte(key)
          f.write(buf)
  
imports: from array import array
  from whoosh.compat import xrange
  from whoosh.system import emptybytes
  from whoosh.system import pack_byte, unpack_byte
  from whoosh.system import pack_ushort_le, unpack_ushort_le
  from whoosh.system import pack_uint_le, unpack_uint_le
label_desc: Use image node_id 2 for calling the GInts obj's underlying member method code with example usage: obj.write_nums(f, numbers) without return types