<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _attach_handler_events(self, handler, events=None):
 """ Search handler for methods named after events, attaching to event handlers as applicable. :param object handler: Handler instance :param list events: List of event names to look for. If not specified, will do all known event names. """

        if not events:
            events = self
        for name in events:
            meth = getattr(handler, name, None)
            if meth:
                self.events[name] += meth