human
I wrote the below code

    assert (((width * height) * 3) == len(buf))
    bpp = 3
    def raw_data():
        row_bytes = (width * bpp)
        for row_start in range((((height - 1) * width) * bpp), (-1), (- row_bytes)):
            (yield '\x00')
            (yield buf[row_start:(row_start + row_bytes)])
    def chunk(tag, data):
        return [struct.pack('!I', len(data)), tag, data, struct.pack('!I', (4294967295 & zlib.crc32(data, zlib.crc32(tag))))]
    SIGNATURE = '\x89PNG\r\n\x1a\n'
    COLOR_TYPE_RGB = 2
    COLOR_TYPE_RGBA = 6
    bit_depth = 8
    return ''.join(((([SIGNATURE] + chunk('IHDR', struct.pack('!2I5B', width, height, bit_depth, COLOR_TYPE_RGB, 0, 0, 0))) + chunk('IDAT', zlib.compress(''.join(raw_data()), 9))) + chunk('IEND', '')))

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def encode(buf, width, height):