def _sorted_arrangement(arrangement: list, items: list | str) -> list:
    """Elements of arrangement ordered as they appear in items."""
    return sorted(
        arrangement,
        key=lambda item: items.index(item),
    )