def read_frames(self, id_, slice_=None):
    ' Read frames for a single item.\n\n        Parameters\n        ----------\n        id_: str\n            The ID of the item\n        slice_: slice or list of ints:\n            A slice or list of indices with which to select frames.\n\n        Returns\n        -------\n        frames (int), meta(dict)\n            The frames of the item as a list of numpy arrays consisting of\n            image pixel values. And the metadata.\n\n        '
    (frame_infos, meta_data) = self._get_frame_infos(id_)
    slice_element = (slice_ if (slice_ is not None) else slice(0, len(frame_infos)))

    def extract_frame(frame_info):
        self.fp.seek(frame_info.loc)
        record = self.fp.read(frame_info.length)
        img_str = record[:(len(record) - frame_info.pad)]
        img = self.jpeg_decoder(img_str)
        return img
    if isinstance(slice_element, (list, np.ndarray)):
        selected_frame_infos = [frame_infos[idx] for idx in slice_element]
    else:
        selected_frame_infos = frame_infos[slice_element]
    frames = [extract_frame(frame_info) for frame_info in selected_frame_infos]
    return (frames, meta_data)
Read frames for a single item.

Parameters
----------
id_: str
    The ID of the item
slice_: slice or list of ints:
    A slice or list of indices with which to select frames.

Returns
-------
frames (int), meta(dict)
    The frames of the item as a list of numpy arrays consisting of
    image pixel values. And the metadata.
def read_frames(self, id_, slice_=None):
    ' Read frames for a single item.\n\n        Parameters\n        ----------\n        id_: str\n            The ID of the item\n        slice_: slice or list of ints:\n            A slice or list of indices with which to select frames.\n\n        Returns\n        -------\n        frames (int), meta(dict)\n            The frames of the item as a list of numpy arrays consisting of\n            image pixel values. And the metadata.\n\n        '
    (frame_infos, meta_data) = self._get_frame_infos(id_)
    slice_element = (slice_ if (slice_ is not None) else slice(0, len(frame_infos)))

    def extract_frame(frame_info):
        self.fp.seek(frame_info.loc)
        record = self.fp.read(frame_info.length)
        img_str = record[:(len(record) - frame_info.pad)]
        img = self.jpeg_decoder(img_str)
        return img
    if isinstance(slice_element, (list, np.ndarray)):
        selected_frame_infos = [frame_infos[idx] for idx in slice_element]
    else:
        selected_frame_infos = frame_infos[slice_element]
    frames = [extract_frame(frame_info) for frame_info in selected_frame_infos]
    return (frames, meta_data)