def _merge_skyline(self, skylineq, segment):
        """
        Arguments:
            skylineq (collections.deque):
            segment (HSegment):
        """
        if len(skylineq) == 0:
            skylineq.append(segment)
            return

        if skylineq[-1].top == segment.top:
            s = skylineq[-1]
            skylineq[-1] = HSegment(s.start, s.length+segment.length)
        else:
            skylineq.append(segment)
def _merge_skyline ( self , skylineq , segment ) : if len ( skylineq ) == 0 : skylineq . append ( segment ) return if skylineq [ - 1 ] . top == segment . top : s = skylineq [ - 1 ] skylineq [ - 1 ] = HSegment ( s . start , s . length + segment . length ) else : skylineq . append ( segment )
Arguments:
            skylineq (collections.deque):
            segment (HSegment):