third_party/blink/renderer/build/scripts/core/css/make_css_value_id_mappings.py
def _find_continuous_segment(numbers):
    """Find the longest continuous segment in a list of numbers.
    For example:
        input:
                1, 2, 3, 4, 5, 6
               22,70,23,24,25,26
        output:
            number_list_sorted:
                1, 3, 4, 5, 6, 2
               22,23,24,25,26,70
            segments:
                0, 1, 5, 6
            which means there are 3 segment with start and end indices
            on the number_list_sorted to be: (0, 1), (1, 5), (5, 6)

    Args:
        numbers: List of pairs of number

    Returns:
        segment: a list containing the indices of the segment start point
            and end point.
        number_list: sorted by the first element version of the input.

    """
    segments = [0]
    number_list_sorted = sorted(numbers, key=lambda elem: elem[0])
    for i in range(len(number_list_sorted) - 1):
        # continuous segment is a segment which the number in pair is 1 unit
        # more than the previous pair
        if (number_list_sorted[i + 1][0] - number_list_sorted[i][0] != 1 or
                number_list_sorted[i + 1][1] - number_list_sorted[i][1] != 1):
            segments.append(i + 1)
    segments.append(len(number_list_sorted))
    return segments, number_list_sorted
Find the longest continuous segment in a list of numbers.
    For example:
        input:
                1, 2, 3, 4, 5, 6
               22,70,23,24,25,26
        output:
            number_list_sorted:
                1, 3, 4, 5, 6, 2
               22,23,24,25,26,70
            segments:
                0, 1, 5, 6
            which means there are 3 segment with start and end indices
            on the number_list_sorted to be: (0, 1), (1, 5), (5, 6)

    Args:
        numbers: List of pairs of number

    Returns:
        segment: a list containing the indices of the segment start point
            and end point.
        number_list: sorted by the first element version of the input.

    
Find the longest continuous segment in a list of numbers.
Find the longest continuous segment in a list of numbers .
def _find_continuous_segment(numbers):
    segments = [0]
    number_list_sorted = sorted(numbers, key=lambda elem: elem[0])
    for i in range(len(number_list_sorted) - 1):
        if (number_list_sorted[i + 1][0] - number_list_sorted[i][0] != 1 or
                number_list_sorted[i + 1][1] - number_list_sorted[i][1] != 1):
            segments.append(i + 1)
    segments.append(len(number_list_sorted))
    return segments, number_list_sorted
def _find_continuous_segment ( numbers ) : segments = [ 0 ] number_list_sorted = sorted ( numbers , key = lambda elem : elem [ 0 ] ) for i in range ( len ( number_list_sorted ) - 1 ) : if ( number_list_sorted [ i + 1 ] [ 0 ] - number_list_sorted [ i ] [ 0 ] != 1 or number_list_sorted [ i + 1 ] [ 1 ] - number_list_sorted [ i ] [ 1 ] != 1 ) : segments . append ( i + 1 ) segments . append ( len ( number_list_sorted ) ) return segments , number_list_sorted
Find the longest continuous segment in a list of numbers.
Find the longest continuous segment in a list of numbers .
"""Find the longest continuous segment in a list of numbers.
    For example:
        input:
                1, 2, 3, 4, 5, 6
               22,70,23,24,25,26
        output:
            number_list_sorted:
                1, 3, 4, 5, 6, 2
               22,23,24,25,26,70
            segments:
                0, 1, 5, 6
            which means there are 3 segment with start and end indices
            on the number_list_sorted to be: (0, 1), (1, 5), (5, 6)

    Args:
        numbers: List of pairs of number

    Returns:
        segment: a list containing the indices of the segment start point
            and end point.
        number_list: sorted by the first element version of the input.

    """ # continuous segment is a segment which the number in pair is 1 unit # more than the previous pair
a list containing the indices of the segment start point
and end point.
number_list: sorted by the first element version of the input.
a list containing the indices of the segment start point and end point . number_list : sorted by the first element version of the input .
segment
numbers
List of pairs of number
List of pairs of number