human
Here's a good function header given the following:
I wrote the below code

    if (db_chunk_size is None):
        db_chunk_size = (chunk_size // len(queries))
    assert (db_chunk_size >= 2)
    assert (chunk_size >= 2)
    if (id_collector is not None):
        assert (len(id_collector) == 0)
    else:
        id_collector = set()
    def chunkify(q, i):
        q = q.order_by('id')
        min_id = (-1)
        while True:
            assert (db_chunk_size is not None)
            rows = list(q.filter(id__gt=min_id)[0:db_chunk_size])
            if (len(rows) == 0):
                break
            for row in rows:
                (yield (row.id, i, row))
            min_id = rows[(-1)].id
    iterators = [chunkify(q, i) for (i, q) in enumerate(queries)]
    merged_query = heapq.merge(*iterators)
    while True:
        tup_chunk = list(itertools.islice(merged_query, 0, chunk_size))
        if (len(tup_chunk) == 0):
            break
        tup_ids = set([tup[0] for tup in tup_chunk])
        assert (len(tup_ids) == len(tup_chunk))
        assert (len(tup_ids.intersection(id_collector)) == 0)
        id_collector.update(tup_ids)
        (yield [row for (row_id, i, row) in tup_chunk])

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

def query_chunker(queries, id_collector=None, chunk_size=1000, db_chunk_size=None):