def sortable_label(label, separator='-'):
    """ Create a sortable tuple out of a label.
    Converts a dashed label into a tuple based on the following rules:
        - If a segment is numeric, it will get three leading zero places
        - If a segment is alphabetic and is already uppercase, it is
            returned as is.
        - If a segment is alphabetic but is not all uppercase, it is
            lowercased entirely.
        - Anything else is returned as-is.
    Intended to be used like `sorted(sections, key=Section.sortable_label)`
    """
    segments = []
    for segment in label.split(separator):
        if segment.isdigit():
            segments.append(segment.zfill(4))
        elif segment.isalpha() and segment.isupper():
            segments.append(segment)
        elif segment.isalpha():
            segments.append(segment.lower())
        else:
            segments.append(segment)
    return tuple(segments)