def get_driver_by_provider(provider): if provider is None: provider = config.PROVIDER.default_router_provider elif provider not in ROUTER_DRIVERS: raise nexc.ProviderNotFound(provider=provider) return ROUTER_DRIVERS[provider]
def get_provider_with_default(provider): if not attr.is_attr_set(provider): provider = config.PROVIDER.default_router_provider elif provider not in ROUTER_DRIVERS: raise nexc.ProviderNotFound(provider=provider) return provider