def format_message(self, message):
        message = self.normalize_message(message)
        username = message['n_user']
        kind = message.get('kind')
        created = None
        group = message['n_group']
        topic = message['n_topic']
        message_body = message['n_message']
        try:
            created = datetime.fromtimestamp(message['_ts'])
        except (__HOLE__, TypeError):
            pass
        if not created:
            try:
                created = datetime.fromtimestamp(message['date_created'])
            except (KeyError, TypeError):
                created = datetime.now()

        if len(topic) > 15:
            topic = topic[:15] + "..."


        if group and topic:
            label = "[{group}/{topic}]".format(**locals())
        else:
            label = ''
        body=wrap_string(message_body, indent=6).lstrip()
        time=created.strftime('%H:%M')
        # I know explicit is better than implicit - but I'm taking the lazy **locals route
        # in this limited context
        if kind == 'message':
            return '{time} <{username}> {label} {body}'.format(**locals())
        elif kind == 'topic':
            return '{time} <{username}> created new topic in #{group}: "{topic}"'.format(**locals())
        elif kind == 'mention':
            return '{time} <{username}> mentioned you: {label} {body}'.format(**locals())            
        elif kind == 'topic-delete':
            return '{time} <{username}> deleted a topic'.format(**locals())            
        else:
            return "{time} <{username}> [{group}]: {kind}".format(**locals())
dataset/ETHPy150Open ptone/notifyore/notifyore/notifiers/stream.py/StreamNotifier.format_message