def getPluginsByLongOption(self, longOption):
        """
        Return the Trial reporter plugin with the given long option.

        If more than one is found, raise ValueError. If none are found, raise
        IndexError.
        """
        plugins = [
            plugin for plugin in getPlugins(IReporter)
            if plugin.longOpt == longOption]
        if len(plugins) > 1:
            raise ValueError(
                "More than one plugin found with long option %r: %r"
                % (longOption, plugins))
        return plugins[0]

        Return the Trial reporter plugin with the given long option.

        If more than one is found, raise ValueError. If none are found, raise
        IndexError.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_plugins.py