<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_listener(self, listener, message_type, data=None, one_shot=False):
 """Add a listener that will receice incoming messages."""

        lst = self._one_shots if one_shot else self._listeners

        if message_type not in lst:
            lst[message_type] = []

        lst[message_type].append(Listener(listener, data))