def from_frame(cls, frame, filepath=None):
        """Creates a sample from the given frame.

        Args:
            frame: a :class:`fiftyone.core.frame.Frame`
            filepath (None): the path to the corresponding image frame on disk,
                if not available

        Returns:
            a :class:`Sample`
        """
        kwargs = {k: v for k, v in frame.iter_fields()}
        if filepath is not None:
            kwargs["filepath"] = filepath

        return cls(**kwargs)
Creates a sample from the given frame.

        Args:
            frame: a :class:`fiftyone.core.frame.Frame`
            filepath (None): the path to the corresponding image frame on disk,
                if not available

        Returns:
            a :class:`Sample`
        
fiftyone/core/sample.py