code: def write_chunk(stream, buf):
      """Write a byte chunk to the stream with magics, length, and padding."""
      nbytes = bytelen(buf)
      stream.write(magic_bytes)
      stream.write(struct.pack("@q", nbytes))
      stream.write(bytedata(buf))
      padding = roundup(nbytes) - nbytes
      if padding > 0:
          stream.write(b"\0" * padding)
  
imports: import struct
  import sys
  import numpy
label_desc: Use image node_id 16 for calling a global function with example usage: write_chunk(stream, buf) without return types