def get_plugin_of_type(self, plugin_class):
logger.debug("<STR_LIT>", plugin_class)<EOL>matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)]<EOL>if matches:<EOL><INDENT>if len(matches) > <NUM_LIT:1>:<EOL><INDENT>logger.debug(<EOL>"<STR_LIT>",<EOL>plugin_class)<EOL><DEDENT>return matches[-<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>raise KeyError("<STR_LIT>" % plugin_class)<EOL><DEDENT>
Retrieve a plugin of desired class, KeyError raised otherwise