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

    def test_method(self):
        r = method(self)
        loop = self.io_loop
        if expect_success:
            self.pullstream.on_recv(self.on_message_succeed)
        else:
            self.pullstream.on_recv(self.on_message_fail)
        loop.call_later(1, self.attempt_connection)
        loop.call_later(1.2, self.send_msg)
        if expect_success:
            loop.call_later(2, self.on_test_timeout_fail)
        else:
            loop.call_later(2, self.on_test_timeout_succeed)
        loop.start()
        if self.fail_msg:
            self.fail(self.fail_msg)
        return r
    return test_method

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

def with_ioloop(method, expect_success=True):