import random


def resample(a, b):
    """
    Pools two lists together and randomly splits them back into two.

    Example:
        [a, b, c] & [1, 2, 3] -> [b, 3, 2] & [c, 1, a]

    :param a: first list
    :param b: second list
    :return: pair of randomly mixed lists
    """
    pool = a + b
    random.shuffle(pool)
    X, Y = pool[:int(len(pool)/2)], pool[int(len(pool)/2):]
    return X, Y