Filter selection

        Filter items of selection that cannot be moved (i.e. are not instances of `Item`) and return the rest.
763415
def movable_items(self):
        
        view = self.view

        if self._move_name_v:
            yield InMotion(self._item, view)
        else:
            selected_items = set(view.selected_items)
            for item in selected_items:
                if not isinstance(item, Item):
                    continue
                yield InMotion(item, view)
577418
def should_filter(items):
    
    return (vcfutils.get_paired(items) is not None and
            any("damage_filter" in dd.get_tools_on(d) for d in items))
769697
def filterCollapsedItems(data):
  """"""
  return ((key, value)\
          for key, value in six.iteritems(data) \
          if not (isinstance(value, StatContainer) and value.isCollapsed()))
413976
def _not_none(items):
    """"""
    if not isinstance(items, (tuple, list)):
        items = (items,)
    return all(item is not _none for item in items)
1093648
function _get_selected_items(){
	
	var ret_filters = [];

	// Push out the filters that have selected == true.
	var all_filters = _get_all_items();
	for( var afi = 0; afi < all_filters.length; afi++ ){
	    var filter_name = all_filters[afi];
	    var fconf = anchor.current_data[filter_name];
	    if( fconf &&
		typeof fconf['selected'] != 'undefined' &&
		fconf['selected'] == true ){
		    ret_filters.push(filter_name);
		}
	}

	return ret_filters;
    }
608967
def items(self):
        ''''''
        if hasattr(self, '_items'):
            return self.filter_items(self._items)
        self._items = self.get_items()
        return self.filter_items(self._items)
183170
def selectnotnone(table, field, complement=False):
    """"""

    return select(table, field, lambda v: v is not None,
                  complement=complement)
621781
def exclude(self, *args, **kwargs):
        
        if args or kwargs:
            self.q_filters = Q(self.q_filters & ~Q(*args, **kwargs))
        return self
493503
def _filter(self, value):
        
        if self.ignores and value in self.ignores:
            return False
        return True
804720
def filteritems(predicate, dict_):
    
    predicate = all if predicate is None else ensure_callable(predicate)
    ensure_mapping(dict_)
    return dict_.__class__(ifilter(predicate, iteritems(dict_)))
208594
def accept(self, item):
        
        accept = self.filter(item)
        if accept and self.item_limit is not None:
            if self.item_limit > 0:
                self.item_limit -= 1
            elif self.strict:
                return False
        return accept
979230
def filter(self, exclude):
        """"""
        filtered_headers = HeaderDict()
        lowercased_ignore_list = [x.lower() for x in exclude]

        for header, value in iteritems(self):
            if header.lower() not in lowercased_ignore_list:
                filtered_headers[header] = value

        return filtered_headers
1229495
def get_select_items(items):
    """"""
    option_items = list()
    for item in items:
        if isinstance(item, dict) and defs.VALUE in item and defs.LABEL in item:
            option_items.append(item[defs.VALUE])
        else:
            raise exceptions.ParametersFieldError(item, "a dictionary with {} and {}"
                                                  .format(defs.LABEL, defs.VALUE))
    return option_items
544705
function () {
				var oBinding = this.byId("tree").getBinding("items");
				if (this._sFilter) {
					oBinding.filter(new Filter({
						path: "name",
						operator: FilterOperator.Contains,
						value1: this._sFilter
					}));
					return true;
				} else {
					oBinding.filter();
					return false;
				}
			}
163682
function applyFilter(data, restrictedFields, allowedFields) {
    var filterFunc;

    // if string, something like a sort where each word should be a value
    var isString = _.isString(data);
    if (isString) { data = data.split(' '); }

    if (restrictedFields) {
        filterFunc = _.isArray(data) ? removeItemsFromList : removeFieldsFromObj;
        data = filterFunc(data, restrictedFields);
    }
    else if (allowedFields) {
        filterFunc = _.isArray(data) ? getItemsFromList : getFieldsFromObj;
        data = filterFunc(data, allowedFields);
    }

    return isString ? data[0] : data;
}
219275
@Override
    public boolean accepts(Item item, List<Item> acceptedItems, List<Item> rejectedItems,
                           boolean runningBeforeProcessing) {
        boolean accepted = true;

        if (CollectionUtils.isNotEmpty(filters)) {
            for (Iterator<ItemFilter> filterIter = filters.iterator(); accepted && filterIter.hasNext();) {
                ItemFilter filter = filterIter.next();
                if (runningBeforeProcessing && filter.runBeforeProcessing()) {
                    accepted = filter.accepts(item, acceptedItems, rejectedItems, runningBeforeProcessing);
                } else if (!runningBeforeProcessing && filter.runAfterProcessing()) {
                    accepted = filter.accepts(item, acceptedItems, rejectedItems, runningBeforeProcessing);
                }
            }
        }

        return accepted;
    }
1276355
def unselect_item(self, item):
        
        self.queue_draw_item(item)
        if item.model in self._selection:
            with self._suppress_selection_events():
                self._selection.remove(item.model)
            self.emit('selection-changed', self._get_selected_items())