def connecting(self):
        """Returns True if still connecting (this may encompass several
        different states, such as SSL handshake, authorization, etc)."""
        return self.state in (ConnectionStates.CONNECTING,
                              ConnectionStates.HANDSHAKE,
                              ConnectionStates.AUTHENTICATING,
                              ConnectionStates.API_VERSIONS_SEND,
                              ConnectionStates.API_VERSIONS_RECV)
Returns True if still connecting (this may encompass several
        different states, such as SSL handshake, authorization, etc).
kafka/conn.py