# Buggy code
def ExamineEvent(self, analysis_mediator, event_object, **kwargs):
    """Analyzes an EventObject and tags it according to rules in the tag file.

    Args:
      analysis_mediator: The analysis mediator object (instance of
                         AnalysisMediator).
      event_object: The event object (instance of EventObject) to examine.
    """
    if self._tag_rules is None:
        if self._autodetect_tag_file_attempt:
            # There's nothing to tag with, and we've already tried to find a good
            # tag file, so there's nothing we can do with this event (or any other).
            return
        if not self._AttemptAutoDetectTagFile(analysis_mediator):
            return

    matched_tags = []
    for tag, my_filters in self._tag_rules.iteritems():
        for my_filter in my_filters:
            if my_filter.Match(event_object):
                matched_tags.append(tag)
                break
    if not matched_tags:
        return
    event_tag = event.EventTag()
    event_tag.event_uuid = getattr(event_object, "uuid")
    event_tag.comment = "Tag applied by tagging analysis plugin."
    event_tag.tags = matched_tags
    self._tags.append(event_tag)


# Traceback (AttributeError)
PYTHONPATH=. ./tools/psort.py --analysis list

******************************* Analysis Plugins *******************************
Traceback (most recent call last):
File "./tools/psort.py", line 604, in <module>
if not Main():
File "./tools/psort.py", line 581, in Main
tool.ListAnalysisPlugins()
File "./tools/psort.py", line 297, in ListAnalysisPlugins
analysis_plugins = self._front_end.GetAnalysisPlugins()
File "/home/onager/code/plaso/plaso/frontend/psort.py", line 96, in GetAnalysisPlugins
return analysis_manager.AnalysisPluginManager.ListAllPluginNames()
File "/home/onager/code/plaso/plaso/analysis/manager.py", line 55, in ListAllPluginNames
for cls_obj in interface.AnalysisPlugin.classes.itervalues():
AttributeError: type object 'AnalysisPlugin' has no attribute 'classes'

# Fixed code
def ExamineEvent(self, analysis_mediator, event_object, **kwargs):
    """Analyzes an EventObject and tags it according to rules in the tag file.

    Args:
      analysis_mediator: The analysis mediator object (instance of
                         AnalysisMediator).
      event_object: The event object (instance of EventObject) to examine.
    """
    if self._tag_rules is None:
        if self._autodetect_tag_file_attempt:
            # There's nothing to tag with, and we've already tried to find a good
            # tag file, so there's nothing we can do with this event (or any other).
            return
        if not self._AttemptAutoDetectTagFile(analysis_mediator):
            logging.info(
                "No tag definition file specified, and plaso was not "
                "able to autoselect a tagging file. As no definitions "
                "were specified, no events will be tagged."
            )
            return

    matched_tags = []
    for tag, my_filters in self._tag_rules.iteritems():
        for my_filter in my_filters:
            if my_filter.Match(event_object):
                matched_tags.append(tag)
                break
    if not matched_tags:
        return
    event_tag = event.EventTag()
    event_tag.event_uuid = getattr(event_object, "uuid")
    event_tag.comment = "Tag applied by tagging analysis plugin."
    event_tag.tags = matched_tags
    logging.debug("Tagging event: {0!s}".format(event_tag.event_uuid))
    self._tags.append(event_tag)