'Used for paste app factories in paste.deploy config files.
Any local configuration (that is, values under the [filter:APPNAME]
section of the paste config) will be passed into the `__init__` method
as kwargs.
A hypothetical configuration would look like:
[filter:analytics]
redis_host = 127.0.0.1
paste.filter_factory = keystone.analytics:Analytics.factory
which would result in a call to the `Analytics` class as
import keystone.analytics
keystone.analytics.Analytics(app, redis_host=\'127.0.0.1\')
You could of course re-implement the `factory` method in subclasses,
but using the kwarg passing it shouldn\'t be necessary.'

@classmethod
def factory(cls, global_config, **local_config):

    def _factory(app):
        conf = global_config.copy()
        conf.update(local_config)
        return cls(app, **local_config)
    return _factory
