def clone_from_given_identity(self, request, *args, **kwargs) -> Response:  # type: ignore[no-untyped-def]
        """
        Clone feature states from a given source identity.
        """
        # Get and validate source identity
        serializer = EdgeIdentitySourceIdentityRequestSerializer(
            data=request.data, context={"request": request}
        )
        serializer.is_valid(raise_exception=True)

        source_identity: EdgeIdentity = self.get_identity(
            edge_identity_identity_uuid=serializer.validated_data[
                "source_identity_uuid"
            ]
        )

        self.identity.clone_flag_states_from(source_identity)
        self.identity.save(user=request.user)

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

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