lisa.utils.order_as#

lisa.utils.order_as(items, order_as, key=None)[source]#

Reorder the iterable of items to match the sequence in order_as. Items present in items and not in order_as will be appended at the end, in appearance order.

Parameters:

key (collections.abc.Callable) – If provided, will be called on each item of items before being compared to order_as to determine the order.