<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def split_pieces(piece_list, segments, num):
 """ Prepare a list of all pieces grouped together """

    piece_groups = []
    pieces = list(piece_list)
    while pieces:
        for i in range(segments):
            p = pieces[i::segments][:num]
            if not p:
                break
            piece_groups.append(p)
        pieces = pieces[num * segments:]

    return piece_groups