def set_identity(self, request, pk=None, identity=None):
        subscriber = self.get_object()
        if [identity] != request.data.keys():
             raise serializers.ValidationError("identity %s does not match keys in request body (%s)" % (identity, ",".join(request.data.keys())))
        ser = IdentitySerializer(subscriber.identity, data=request.data)
        ser.is_valid(raise_exception = True)
        subscriber.update_identity(ser.validated_data)
        subscriber.save()
        return Response({identity: IdentitySerializer(subscriber.identity).data[identity]})
dataset/ETHPy150Open open-cloud/xos/xos/api/tenant/cord/subscriber.py/CordSubscriberViewSet.set_identity/original