def generate_atom(self, event, event_type, content, content_type,
                      categories=None, title=None):
        template = ("""<atom:entry xmlns:atom="http://www.w3.org/2005/Atom">"""
                    """<atom:id>urn:uuid:%(message_id)s</atom:id>"""
                    """%(categories)s"""
                    """<atom:title type="text">%(title)s</atom:title>"""
                    """<atom:content type="%(content_type)s">%(content)s"""
                    """</atom:content></atom:entry>""")
        if title is None:
            title = event_type
        if categories is None:
            cats = []
        else:
            cats = categories[:]
        cats.append(event_type)
        original_message_id = event.get('original_message_id')
        if original_message_id is not None:
            cats.append('original_message_id:%s' % original_message_id)
        cattags = ''.join("""<atom:category term="%s" />""" % cat
                          for cat in cats)
        info = dict(message_id=event.get('message_id'),
                    original_message_id=original_message_id,
                    event=event,
                    event_type=event_type,
                    content=content,
                    categories=cattags,
                    title=title,
                    content_type=content_type)
        return template % info
dataset/ETHPy150Open openstack/stacktach-winchester/winchester/pipeline_handler.py/AtomPubHandler.generate_atom/original