human
I wrote the below code

    def is_in_states(units):
        for unit in units:
            if (unit.name == unit_name):
                if (unit.activation_state in expected_activation_states):
                    return True
    def check_if_in_states():
        responded = docker_client.list()
        responded.addCallback(is_in_states)
        return responded
    return loop_until(reactor, check_if_in_states)

What's a good function header?

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

def wait_for_unit_state(reactor, docker_client, unit_name, expected_activation_states):