def pack(list_a: list):
    """Problem 9: Pack Consecutive Duplicates of a List.

    Parameters
    ----------
    list_a : list
        The input list

    Returns
    -------
    list of list
        A list of lists packed with consecutive duplicates

    Raises
    ------
    TypeError
        If the given argument is not of `list` type

    """
    if not isinstance(list_a, list):
        raise TypeError('The argument given is not of `list` type.')

    if len(list_a) <= 1:
        # In case of empty or one-element list return.
        return [list_a]

    packed, sublist = [], [list_a[0]]
    for element in list_a[1:]:
        if sublist[-1] != element:
            # If current element does not match the last of the sublist
            # extend packed list and reset sublist to a single-element
            packed.append(sublist)
            sublist = [element]
        else:
            # If another same element is found, append to the sublist
            sublist.append(element)
    packed.append(sublist)

    return packed