def make_identity(*columns):
    """
    Factory function that returns an identity function that can be used in :func:`save`.

    The identity function returns an identity-tuple mapping from a model instance with the given
    `columns` and their values.
    """

    def identity(model):
        return tuple((col, getattr(model, col.key)) for col in columns)

    return identity