def clone_from_given_identity(self, request, *args, **kwargs) -> Response:  # type: ignore[no-untyped-def]
        """
        Clone feature states from a given source identity.
        """
        serializer = IdentitySourceIdentityRequestSerializer(
            data=request.data, context={"request": request}
        )
        serializer.is_valid(raise_exception=True)
        # Get and validate source and target identities
        target_identity = get_object_or_404(
            queryset=Identity, pk=self.kwargs["identity_pk"]
        )
        source_identity = get_object_or_404(
            queryset=Identity, pk=request.data.get("source_identity_id")
        )

        # Clone feature states
        FeatureState.copy_identity_feature_states(
            target_identity=target_identity, source_identity=source_identity
        )

        return self.all(request, *args, **kwargs)  # type: ignore[no-any-return]

        Clone feature states from a given source identity.
        
api/features/views.py