def multisorted(items, *keys):
    """Sort by multiple attributes.

    Args:
        items: An iterable series to be sorted.
        *keys: Key objects which extract key values from the items.
            The first key will be the most significant, and the
            last key the least significant. If no key functions
            are provided, the items will be sorted in ascending
            natural order.
    Returns:
        A list of items sorted according to keys.
    """
    if len(keys) == 0:
        keys = [asc()]
    for key in reversed(keys):
        items = sorted(items, key=key.func, reverse=key.reverse)
    return items
Sort by multiple attributes.

    Args:
        items: An iterable series to be sorted.
        *keys: Key objects which extract key values from the items.
            The first key will be the most significant, and the
            last key the least significant. If no key functions
            are provided, the items will be sorted in ascending
            natural order.
    Returns:
        A list of items sorted according to keys.