def apply(self, working_list, act_on):
        """
        Apply filters to a working list of indices/snapshots and
        return resulting list.
        """
        self.act_on = act_on
        result_list = self._apply_closed_timerange(working_list)

        if self.all_items:
            logger.info('Matching all %s. Ignoring parameters other than exclude.', self.act_on)

        # Closed time range couldn't be applied
        if result_list is None:
            result_list = working_list

        # Apply filters one by one (if any) from the list.
        for f in self.built_list:
            is_timebased = f.get('method', None) in ('newer_than', 'older_than')
            # Don't apply timebased filters for a closed time range.
            if self.closed_timerange and is_timebased:
                continue
            # When all items are seleted ignore filters other than exclude
            if self.all_items and 'exclude' not in f:
                continue

            logger.debug('Applying filter: %s', f)
            result_list = apply_filter(result_list, **f)

        return result_list
dataset/ETHPy150Open StackStorm/st2contrib/packs/elasticsearch/actions/lib/items_filter.py/ItemsFilter.apply/original