def list_to_ranges(list_of_ints, range_sep=',', slice_sep=':'):
    """
    Get a ranges-str for input list

    Parameters
    ----------
    list_of_ints : list[int]
        A list of integers to codify as a ranges-str
    range_sep : str default ','
        A range seperator string
    slice_sep : str default ':'
        A slice seperator string, range with only number `x` will be treated 
        as singleton integer memeber (not a 0..x range)
        
    Returns
    -------
    str
        A ranges_string, with ranges delimited by ',' and slice char ':'

    """
    t = [(i - 1, list_of_ints[i] - list_of_ints[i - 1]) for i in range(1, len(list_of_ints))]
    i = 0
    e = t[i]
    i += 1
    res = []
    while i < len(t):
        is_range = False
        if t[i][1] - e[1] == 0:
            while i < len(t) and t[i][1] - e[1] == 0:
                i += 1
                is_range = True
            if is_range:
                f = t[i - 1]
                r1 = (list_of_ints[e[0]], list_of_ints[f[0] + 1], f[1]
                      ) if f[1] != 1 else (list_of_ints[e[0]], list_of_ints[f[0] + 1])
                res.append(r1)
            else:
                res.extend([list_of_ints[e[0]], list_of_ints[e[0]]])
            i += 1
        else:
            res.extend([list_of_ints[e[0]]])

        if i < len(t):
            e = t[i]
            i += 1
            if i == len(t):
                res.extend([list_of_ints[e[0]], list_of_ints[e[0]]])
    rs1 = range_sep.join([slice_sep.join(str(n) for n in elm) if isinstance(
        elm, tuple) else str(elm) for elm in res])
    return rs1