def _filter_slabs(provisional, max_size): 
    """
    Filters the repeat slabs from the list of all the zero dipole slabs. 
    Creates lists of large and repeat slabs if any are present for the warnings

    Args: 
        provisional (`list`): All zero dipole slabs generated with SlabGenerator
        max_size (`int`): The maximum number of atoms in the slab 
            specified to raise warning about slab size.
    
    Returns: 
        list of dictionaries with slabs, list of repeat slabs, list of slabs 
        larger than the max_size 
    """
    # Iterate though provisional slabs to extract the unique slabs
    unique_list, unique_list_of_dicts, repeat, large = ([] for i in range(4))

    for slab in provisional:
        if slab['slab'] not in unique_list:
            unique_list.append(slab['slab'])
            unique_list_of_dicts.append(slab)
            
            # For large slab size warning
            atoms = len(slab['slab'].atomic_numbers)
            if atoms > max_size:
                large.append('{}_{}_{}_{}'.format(slab['hkl'], 
                slab['slab_thickness'], slab['vac_thickness'], slab['slab_index']))

        # For repeat slabs warning
        else:
            repeat.append('{}_{}_{}_{}'.format(slab['hkl'], 
            slab['slab_thickness'], slab['vac_thickness'], slab['slab_index']))

    return unique_list_of_dicts, repeat, large