def _include_or_exclude(selected, given, mode):
    """Include or exclude the selected Atoms from the initially given Atoms."""
    if mode == 'exclude':
        selected = [atom for atom in given if atom not in selected]
    return selected