human
Complete this python program:
def _AddSetListenerMethod(cls):
assistant
#Here is the Python code you requested.

    """Helper for _AddMessageMethods().
    """
    def SetListener(self, listener):
        if (listener is None):
            self._listener = message_listener_mod.NullMessageListener()
        else:
            self._listener = listener
    cls._SetListener = SetListener