<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_plugin(cls, name=None, **kwargs):
 """Returns the first format plugin whose attributes match kwargs. For example:: get_plugin(extension="scratch14") Will return the :class:`KurtPlugin` whose :attr:`extension <KurtPlugin.extension>` attribute is ``"scratch14"``. The :attr:`name <KurtPlugin.name>` is used as the ``format`` parameter to :attr:`Project.load` and :attr:`Project.save`. :raises: :class:`ValueError` if the format doesn't exist. :returns: :class:`KurtPlugin` """

        if isinstance(name, KurtPlugin):
            return name

        if 'extension' in kwargs:
            kwargs['extension'] = kwargs['extension'].lower()
        if name:
            kwargs["name"] = name
        if not kwargs:
            raise ValueError, "No arguments"

        for plugin in cls.plugins.values():
            for name in kwargs:
                if getattr(plugin, name) != kwargs[name]:
                    break
            else:
                return plugin

        raise ValueError, "Unknown format %r" % kwargs