human
I wrote the below code

    acc = deque()
    def on_message(body, message):
        acc.append((body, message))
    consumer.callbacks = ([on_message] + (callbacks or []))
    with consumer:
        for _ in eventloop(consumer.channel.connection.client, limit=limit, timeout=timeout, ignore_timeouts=True):
            try:
                (yield acc.popleft())
            except IndexError:
                pass

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

def drain_consumer(consumer, limit=1, timeout=None, callbacks=None):