Motorola Solutions CommandCentral receives alert priorities that must be ordered before they are displayed or processed. Implement a stable merge sort that returns the priorities in ascending order without using Python's built-in sort() or sorted() functions.
Write sort_priorities(priorities), where priorities is a list of integers. Return a new list containing the same values in nondecreasing order. The input list must not be modified. Duplicate values must be preserved, and the algorithm must remain stable if equal-priority records are later extended with metadata.
def sort_priorities(priorities):