human
Solve the following python programming problem given the following code:
def _connect_once(self, reactor, transport_config) : 
    self.log.info ('connecting once using transport type "{transport_type}" over endpoint type "{endpoint_type}"', transport_type = transport_config ['type'], endpoint_type = transport_config ['endpoint'] ['type']) 
    done = txaio.create_future () 
    def create_session() : 
        cfg = ComponentConfig (self._realm, self._extra) 
        try : 
            session = self.session (cfg) 
except Exception : 
            raise 
else : 
            session._parent = self 
            if (self._entry_type == Component.TYPE_MAIN) : 
                def on_join(session, details) : 
                    self.log.debug ('session on_join: {details}', details = details) 
                    d = txaio.as_future (self._entry, reactor, session) 
                    def main_success(_) : 
                        self.log.debug ('main_success') 
                        txaio.resolve (done, None) 
def main_error(err) : 
                        self.log.debug ('main_error: {err}', err = err) 
                        txaio.reject (done, err) 
txaio.add_callbacks (d, main_success, main_error) 
session.on ('join', on_join) 
else : 
                if (self._entry_type == Component.TYPE_SETUP) : 
                    def on_join(session, details) : 
                        self.log.debug ('session on_join: {details}', details = details) 
                        d = txaio.as_future (self._entry, reactor, session) 
                        def setup_success(_) : 
                            self.log.debug ('setup_success') 
def setup_error(err) : 
                            self.log.debug ('setup_error: {err}', err = err) 
txaio.add_callbacks (d, setup_success, setup_error) 
session.on ('join', on_join) 
else : 
                    assert False, 'logic error' 
def on_leave(session, details) : 
                self.log.debug ('session on_leave: {details}', details = details) 
session.on ('leave', on_leave) 
            def on_disconnect(session, was_clean) : 
               ...
    
    Given the code above, what is a proper replacement for <MASK>?
assistant
#Here is a proper replacement for <MASK>.
def on_connect_sucess(