<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def notify(self, message):
 """Callback function which checks lines of output, tries to match against regex defined in subclass's "dispatch" dict, and passes through to a handler on match. """

        for regex, handler in self.dispatch.items():
            match = re.search(regex, message)
            if match:
                handler = getattr(self, handler)
                return handler(match)