def _ensure_frames(cls, documents):
        """
        Ensure all items in a list are frames by converting those that aren't.
        """
        frames = []
        for document in documents:
            if not isinstance(document, Frame):
                frames.append(cls(document))
            else:
                frames.append(document)
        return frames
Ensure all items in a list are frames by converting those that aren't.