def sort_categories(categories):
    """Apply our special sort order (Misc is last) to the category list."""
    out = sorted(categories)
    if 'Misc' in out:
        out.remove('Misc')
        out.append('Misc')
    return out