def add_douban_login(config,
                     consumer_key,
                     consumer_secret,
                     scope=None,
                     login_path='/login/douban',
                     callback_path='/login/douban/callback',
                     name='douban'):
    provider = DoubanProvider(name, consumer_key, consumer_secret, scope)

    config.add_route(provider.login_route, login_path)
    config.add_view(provider, attr='login', route_name=provider.login_route,
                    permission=NO_PERMISSION_REQUIRED)

    config.add_route(provider.callback_route, callback_path,
                     use_global_views=True,
                     factory=provider.callback)

    register_provider(config, name, provider)
Return a new, realistic failure.
dataset/ETHPy150Open bbangert/velruse/velruse/providers/douban.py/add_douban_login--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/trial/test/test_log.py/makeFailure