def retain_all(self, items):
check_not_none(items, "<STR_LIT>")<EOL>data_items = []<EOL>for item in items:<EOL><INDENT>check_not_none(item, "<STR_LIT>")<EOL>data_items.append(self._to_data(item))<EOL><DEDENT>return self._encode_invoke(list_compare_and_retain_all_codec, values=data_items)<EOL>
Retains only the items that are contained in the specified collection. It means, items which are not present in
the specified collection are removed from this list.

:param items: (Collection), collections which includes the elements to be retained in this list.
:return: (bool), ``true`` if this list changed as a result of the call.