<qiyuangong>056_Merge_Intervals_1.py
def merge( intervals):
    if intervals is None:
        return
    ls = len(intervals)
    if ls <= 1:
        return intervals
    intervals.sort(key=lambda x: x.start)
    pos = 0
    while pos < len(intervals) - 1:
        if intervals[pos].end >= intervals[pos + 1].start:
            next = intervals.pop(pos + 1)
            if next.end > intervals[pos].end:
                intervals[pos].end = next.end
        else:
            pos += 1
    return intervals
def sample_funcname ( var_0 ) :
    if var_0 is None :
        return
    var_3 = len ( var_0 )
    if var_3 <= 1 :
        return var_0
    var_0.sort ( var_6 = lambda var_7 : var_7.start )
    var_10 = 0
    while var_10 < len ( var_0 ) - 1 :
        if var_0 [ var_10 ].end >= var_0 [ var_10 + 1 ].start :
            var_13 = var_0.pop ( var_10 + 1 )
            if var_13.end > var_0 [ var_10 ].end :
                var_0 [ var_10 ].end = var_13.end
        else :
            var_10 += 1
    return var_0
