lisa.utils.order_as#
- lisa.utils.order_as(items, order_as, key=None)[source]#
Reorder the iterable of
items
to match the sequence inorder_as
. Items present initems
and not inorder_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 toorder_as
to determine the order.