def pack_consecutive_duplicates(list1):
    from itertools import groupby
    
    return [list(group) for key, group in groupby(list1)]
def pack_consecutive_duplicates(list1):
    from itertools import groupby
   
    return [list(z4i0K) for key, z4i0K in groupby(list1)]