def _check_filter_horizontal(self, obj):

        if not hasattr(obj, 'filter_horizontal'):
            return []
        elif not isinstance(obj.filter_horizontal, (list, tuple)):
            return must_be('a list or tuple', option='filter_horizontal', obj=obj, id='admin.E018')
        else:
            return list(chain(*[
                self._check_filter_item(obj, obj.model, field_name, "filter_horizontal[%d]" % index)
                for index, field_name in enumerate(obj.filter_horizontal)
            ]))
Tests that iterating over a query set more than once works
dataset/ETHPy150Open django/django/django/contrib/admin/checks.py/BaseModelAdminChecks._check_filter_horizontal--crossover with--dataset/ETHPy150Open datastax/python-driver/tests/integration/cqlengine/query/test_named.py/TestQuerySetCountSelectionAndIteration.test_multiple_iterations_work_properly