third_party/xcbproto/src/xcbgen/align.py
def is_guaranteed_at(self, external_align):
        '''
        Assuming the given external_align, checks whether
        self is fulfilled for all cases.
        Returns True if yes, False otherwise.
        '''
        if self.align == 1 and self.offset == 0:
            # alignment 1 with offset 0 is always fulfilled
            return True

        if external_align is None:
            # there is no external align -> fail
            return False

        if external_align.align < self.align:
            # the external align guarantees less alignment -> not guaranteed
            return False

        if external_align.align % self.align != 0:
            # the external align cannot be divided by our align
            # -> not guaranteed
            # (this can only happen if there are alignments that are not
            # a power of 2, which is highly discouraged. But better be
            # safe and check for it)
            return False

        if external_align.offset % self.align != self.offset:
            # offsets do not match
            return False

        return True

        Assuming the given external_align, checks whether
        self is fulfilled for all cases.
        Returns True if yes, False otherwise.
        
Assuming the given external_align, checks whether
self is fulfilled for all cases.
Returns True if yes, False otherwise.
Assuming the given external_align checks whether self is fulfilled for all cases . Returns True if yes False otherwise .
def is_guaranteed_at(self, external_align):
        if self.align == 1 and self.offset == 0:
            return True
        if external_align is None:
            return False
        if external_align.align < self.align:
            return False
        if external_align.align % self.align != 0:
            return False
        if external_align.offset % self.align != self.offset:
            return False
        return True
def is_guaranteed_at ( self , external_align ) : if self . align == 1 and self . offset == 0 : return True if external_align is None : return False if external_align . align < self . align : return False if external_align . align % self . align != 0 : return False if external_align . offset % self . align != self . offset : return False return True
Assuming the given external_align, checks whether
self is fulfilled for all cases.
Assuming the given external_align checks whether self is fulfilled for all cases .
'''
        Assuming the given external_align, checks whether
        self is fulfilled for all cases.
        Returns True if yes, False otherwise.
        ''' # alignment 1 with offset 0 is always fulfilled # there is no external align -> fail # the external align guarantees less alignment -> not guaranteed # the external align cannot be divided by our align # -> not guaranteed # (this can only happen if there are alignments that are not # a power of 2, which is highly discouraged. But better be # safe and check for it) # offsets do not match
self
external_align