import random


def merge_sort(arr, k):
    """
       Perform merge sort on a list, splitting it into k parts.

       Args:
           arr (list): The list to be sorted.
           k (int): The number of parts to split the list into.

       Returns:
           list: The sorted list.

       Examples:
           >>> merge_sort([12, 11, 13, 5, 6, 7], 3)
           [5, 6, 7, 11, 12, 13]
    """
    your_code_here = []
    return your_code_here


# testing some random arrays to help you check correctness
if __name__ == "__main__":
    n = 1000
    k_limit = 20
    for k in range(2, k_limit):
        arr = [random.randint(0, 10000) for i in range(n)]
        sorted_arr = merge_sort(arr, k)
        if not sorted_arr == sorted(arr):
            raise Exception("Didn't Sort Correctly!")
    print("seems to work")
