import random


def _partition(list_in, num):
    """Partitions the list in num lists.

    Given a list and n, returns a list with n lists, and inside each of them a
    set of elements from the shuffled list. All lists are of the same size

    :param list_in: List of elements to partition

    :param num: Number of partitions

    :return: List of lists with shuffled elements partitioned
    """
    random.shuffle(list_in)
    return [list_in[idx::num] for idx in range(num)]