def fix_tid(src_tid):
    """ There are currently four ways to describe indices, which have
    to be unrolled into a tuple:

    'x:y' -> [x, x + 1, .. y], e.g. '2:5' -> [2,3,4,5]
    'x_y_z' -> [min, min + 1, .. , max], e.g. '6_7_9' -> [6,7,8,9]
    'x,y,z' -> [x,y,z], e.g. '1,2,3' -> [1,2,3]
    'x' -> [x], e.g. '42' -> [42]

    The unrolled span is sorted and returnd as a tuple.

    Args:
        src_tid (str): tid to fix
    Returns:
        tuple: The unrolled tid
    """

    if ':' in src_tid:
        start, _, end = src_tid.partition(':')
        span = list(range(int(start), int(end) + 1))
    elif '_' in src_tid:
        data = [int(x) for x in src_tid.split('_')]
        min_el, max_el = min(data), max(data)
        span = list(range(min_el, max_el + 1))
    elif ',' in src_tid:
        span = [int(x) for x in src_tid.split(',')]
    else:
        span = [int(src_tid)]

    span.sort()

    return tuple(span)