def extrude(self, uem, reference, collar=0.0, skip_overlap=False):
        """Extrude reference boundary collars from uem

        reference     |----|     |--------------|       |-------------|
        uem       |---------------------|    |-------------------------------|
        extruded  |--| |--| |---| |-----|    |-| |-----| |-----------| |-----|

        Parameters
        ----------
        uem : Timeline
            Evaluation map.
        reference : Annotation
            Reference annotation.
        collar : float, optional
            When provided, set the duration of collars centered around
            reference segment boundaries that are extruded from both reference
            and hypothesis. Defaults to 0. (i.e. no collar).
        skip_overlap : bool, optional
            Set to True to not evaluate overlap regions.
            Defaults to False (i.e. keep overlap regions).

        Returns
        -------
        extruded_uem : Timeline
        """

        if collar == 0. and not skip_overlap:
            return uem

        collars, overlap_regions = [], []

        # build list of collars if needed
        if collar > 0.:
            # iterate over all segments in reference
            for segment in reference.itersegments():

                # add collar centered on start time
                t = segment.start
                collars.append(Segment(t - .5 * collar, t + .5 * collar))

                # add collar centered on end time
                t = segment.end
                collars.append(Segment(t - .5 * collar, t + .5 * collar))

        # build list of overlap regions if needed
        if skip_overlap:
            # iterate over pair of intersecting segments
            for (segment1, track1), (segment2, track2) in reference.co_iter(reference):
                if segment1 == segment2 and track1 == track2:
                    continue
                # add their intersection
                overlap_regions.append(segment1 & segment2)

        segments = collars + overlap_regions

        return Timeline(segments=segments).support().gaps(support=uem)
def extrude ( self , uem , reference , collar = 0.0 , skip_overlap = False ) : if collar == 0. and not skip_overlap : return uem collars , overlap_regions = [ ] , [ ] if collar > 0. : for segment in reference . itersegments ( ) : t = segment . start collars . append ( Segment ( t - .5 * collar , t + .5 * collar ) ) t = segment . end collars . append ( Segment ( t - .5 * collar , t + .5 * collar ) ) if skip_overlap : for ( segment1 , track1 ) , ( segment2 , track2 ) in reference . co_iter ( reference ) : if segment1 == segment2 and track1 == track2 : continue overlap_regions . append ( segment1 & segment2 ) segments = collars + overlap_regions return Timeline ( segments = segments ) . support ( ) . gaps ( support = uem )
Extrude reference boundary collars from uem

        reference     |----|     |--------------|       |-------------|
        uem       |---------------------|    |-------------------------------|
        extruded  |--| |--| |---| |-----|    |-| |-----| |-----------| |-----|

        Parameters
        ----------
        uem : Timeline
            Evaluation map.
        reference : Annotation
            Reference annotation.
        collar : float, optional
            When provided, set the duration of collars centered around
            reference segment boundaries that are extruded from both reference
            and hypothesis. Defaults to 0. (i.e. no collar).
        skip_overlap : bool, optional
            Set to True to not evaluate overlap regions.
            Defaults to False (i.e. keep overlap regions).

        Returns
        -------
        extruded_uem : Timeline