<commit_before>from av.video.frame cimport VideoFrame


cdef class VideoPlane(Plane):
    
    def __cinit__(self, VideoFrame frame, int index):
        
        for i in range(frame.format.ptr.nb_components):
            if frame.format.ptr.comp[i].plane == index:
                self.component = frame.format.components[i]
                break
        else:
            raise RuntimeError('could not find plane %d of %r' % (index, frame.format))

        self.buffer_size = (abs(self.frame.ptr.linesize[self.index]) 
                            * self.component.height)

    property width:
        """Pixel width of this plane."""
        def __get__(self):
            return self.component.width

    property height:
        """Pixel height of this plane."""
        def __get__(self):
            return self.component.height<commit_msg>Document the motivation for the fix<commit_after>from av.video.frame cimport VideoFrame


cdef class VideoPlane(Plane):
    
    def __cinit__(self, VideoFrame frame, int index):
        
        for i in range(frame.format.ptr.nb_components):
            if frame.format.ptr.comp[i].plane == index:
                self.component = frame.format.components[i]
                break
        else:
            raise RuntimeError('could not find plane %d of %r' % (index, frame.format))

        # Sometimes, linesize is negative (and that is meaningful). We are only
        # insisting that the buffer size be based on the extent of linesize, and
        # ignore it's direction.
        self.buffer_size = abs(self.frame.ptr.linesize[self.index]) * self.component.height

    property width:
        """Pixel width of this plane."""
        def __get__(self):
            return self.component.width

    property height:
        """Pixel height of this plane."""
        def __get__(self):
            return self.component.height
{'fraction_non_alphanumeric': 0.09696323921150772, 'fraction_numerical': 0.0, 'mean_word_length': 2.1144278606965172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4694547', 'n_tokens_mistral': 506, 'n_tokens_neox': 490, 'n_words': 149}