def redirect_if_valid_next(self, request):
        if self.sign_next_param:
            try:
                next = signed.loads(
                    request.REQUEST.get('next', ''), extra_key=self.salt_next
                )
                return HttpResponseRedirect(next)
            except ValueError:
                return None
        else:
            next = request.REQUEST.get('next', '')
            if next.startswith('/'):
                return HttpResponseRedirect(next)
            else:
                return None
Helper function for configuring output shape
dataset/ETHPy150Open amarandon/smeuhsocial/apps/django_openid/consumer.py/Consumer.redirect_if_valid_next--crossover with--dataset/ETHPy150Open NervanaSystems/neon/neon/layers/container.py/MergeSum._configure_merge