human
I wrote the below code

    from multiprocessing.pool import ThreadPool
    actions = map(expand_action_callback, actions)
    class BlockingPool(ThreadPool, ):
        def _setup_queues(self):
            super(BlockingPool, self)._setup_queues()
            self._inqueue = Queue(queue_size)
            self._quick_put = self._inqueue.put
    pool = BlockingPool(thread_count)
    try:
        for result in pool.imap((lambda bulk_chunk: list(_process_bulk_chunk(client, bulk_chunk[1], bulk_chunk[0], **kwargs))), _chunk_actions(actions, chunk_size, max_chunk_bytes, client.transport.serializer)):
            for item in result:
                (yield item)
    finally:
        pool.close()
        pool.join()

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

def parallel_bulk(client, actions, thread_count=4, chunk_size=500, max_chunk_bytes=((100 * 1024) * 1024), queue_size=4, expand_action_callback=expand_action, **kwargs):