from typing import List


def parseRanges(rangeStr: str, inlcudeLast: bool = True, unique: bool = True) -> List[int]:
    """
    Parses range strings in the form of 1,2,4:8,9 to a list 1,2,4,5,6,7,8,9
    Args:
        rangeStr (): a range sting separated by commas and :
        inlcudeLast (): If true ranges 1:3 => 1,2,3 if false 1:3 => 1,2
    Returns:
        A list of integers
    """
    ranges = [r.strip() for r in rangeStr.split(',')]
    ret = []
    add = 0
    if inlcudeLast: add = 1

    for r in ranges:
        v = r.split(':')
        if len(v) == 1:  # single number
            ret += [int(v[0])]
        else:  # range in form of a:b
            ret += list(range(int(v[0]), int(v[1]) + add))

    if unique:
        return list(set(ret))

    return ret