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

    TOPIC_NAME = ('subscription_pull_autoack-%d' % (_millis(),))
    SUB_NAME = ('subscription_pull_autoack-defaults-%d' % (_millis(),))
    PAYLOAD1 = 'PAYLOAD1'
    PAYLOAD2 = 'PAYLOAD2'
    EXTRA = 'EXTRA'
    topic = client.topic(TOPIC_NAME)
    topic.create()
    to_delete.append(topic)
    subscription = topic.subscription(SUB_NAME)
    subscription.create()
    to_delete.append(subscription)
    with topic.batch() as batch:
        batch.publish(PAYLOAD1)
        batch.publish(PAYLOAD2, extra=EXTRA)
    time.sleep(1)
    payloads = []
    extras = []
    def do_something_with(message):
        payloads.append(message.data)
        if message.attributes:
            extras.append(message.attributes)
    from google.cloud.pubsub.subscription import AutoAck
    with AutoAck(subscription, max_messages=10) as ack:
        for (ack_id, message) in list(ack.items()):
            try:
                do_something_with(message)
            except Exception:
                del ack[ack_id]
    assert (set(payloads) == set(PAYLOAD1, PAYLOAD1)), 'eventual    consistency'
    assert (extras == [{'extra': EXTRA}]), 'eventual    consistency'

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

@snippet
def subscription_pull_w_autoack(client, to_delete):