def METHOD_NAME(self, request):
    # This will be cached per request, which means that we'll have a stable
    # result for both the identity AND the policy that produced it. Further
    # uses can then make sure to use the same policy throughout, at least
    # where it makes sense to.
    for policy in self._policies:
        if ident := policy.identity(request):
            return ident, policy
    return None, None