@classmethod
def add(cls, name, provider_cls, *provider_args, **provider_kwargs):
    """Adds provider to the registry."""
    if name in cls._REGISTRY:
        raise ValueError('Attempting to register duplicate provider: %s' % name
            )
    provider = provider_cls(*provider_args, **provider_kwargs)
    if not isinstance(provider, cls._PROVIDER_TYPE):
        raise ValueError(
            'Attempting to register a class not of an invalid type. Expecting instance of %s, got %s'
             % (cls._PROVIDER_TYPE, provider_cls))
    cls._REGISTRY[name] = provider
