def METHOD_NAME(self, elements, size):
    groups = []
    offsets = list(range(0, len(elements), size)) + [None]
    for i in range(0, len(offsets) - 1):
        groups.append(elements[offsets[i]:offsets[i+1]])
    return groups