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

    def state_reached():
        d = get_states()
        def find_match(states):
            for state in states:
                if state_matches(state):
                    return state
            return None
        d.addCallback(find_match)
        return d
    d = loop_until(reactor, state_reached)
    _timeout(reactor, d, timeout.total_seconds())
    return d

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

def loop_until_state_found(reactor, get_states, state_matches, timeout):