Adds an object_filter to the result. An Object Filter allows you
 to specify criteria which are used to filter the results returned
 by the server.
342700
def object_filter(filter)
    raise ArgumentError, "object_filter expects an instance of SoftLayer::ObjectFilter" if filter.nil? || !filter.kind_of?(SoftLayer::ObjectFilter)

    # we create a new object in case the user wants to store off the
    # filter chain and reuse it later
    APIParameterFilter.new(self.target, @parameters.merge({:object_filter => filter}));
  end
949544
function filter(object, callback) {
		if (!object) { return true; }
		if (object.filter) { return object.filter(callback); }
		if (object instanceof Array) {
			var result = [],
				length	= array ? array.length : 0;
			for(var index = 0; index < length; index++) {
				if (callback(array[index], index)) {
					result.push(array[index]);
				}
			}
		}else{
			var result = {};
			for(var key in object) {
				if (!object.hasOwnProperty(key)) { continue; }
				if (callback(object[key], key)) {
					result[key] = object[key];
				}
			}
		}
		return false;
	}
1128204
public ServerFilter where(Predicate<ServerMetadata> filter) {
        checkNotNull(filter, "Filter must be not a null");

        predicate = predicate.and(filter);

        return this;
    }
328582
function(filterIndex, options) {
      if (options === undefined) {
        throw new Error('Request filter at index ' + filterIndex + ' returned nothing; it must return the filtered request options');
      } else if (!_.isObject(options)) {
        throw new Error('Expected request filter at index ' + filterIndex + ' to return the request options as an object, got ' + typeof(options));
      }

      return options;
    }
101666
def object_result(self):
        
        num_obj_results = len(self._object_results)

        if num_obj_results < 1:
            return None
        elif num_obj_results < 2:
            return self._object_results[0]
        else:
            raise ValueError("There is more than one result; use 'object_results'")
1262933
def add(type, filter=nil, &block)
      if((filter.nil? && !block_given?) || (filter && !filter.is_a?(Filter)))
        raise ArgumentError.new('Filter or proc must be provided for filter')
      end
      const = Splib.find_const(type)
      type = const unless const.nil?
      @lock.synchronize do
        @filters[type] ||= {}
      end
      if(block_given?)
        unless(block.arity == 1 || block.arity < 0)
          raise ArgumentError.new('Block must accept a parameter')
        end
        @lock.synchronize do
          @filters[type][:procs] ||= []
          unless(@filters[type][:procs].include?(block))
            @filters[type][:procs] << block
          end
        end
      end
      if(filter)
        @lock.synchronize do
          unless(@filters[type].include?(filter))
            @filters[type][:filters] ||= []
            unless(@filters[type][:filters].include?(filter))
              @filters[type][:filters] << filter
            end
          end
        end
      end
      filter ? block_given? ? [filter, block] : filter : block
    end
939565
def for_object(self, instance, flag=''):
        
        check(instance)
        content_type = ContentType.objects.get_for_model(instance).pk
        queryset = self.filter(content_type=content_type, object_id=instance.pk)
        if flag:
            queryset = queryset.filter(flag=flag)
        return queryset
1249145
private void decideTypeFilterToAdd(Filter filter) {
        Filter step = filter;

        if (Operator.MATCH == step.getRelation().getOperator() ||
                step.getRelation().getRightTerm() instanceof FunctionSelector) {
            if (matchList.isEmpty()) {
                matchList = new ArrayList<>();
            }
            matchList.add(filter);
        } else {
            if (filterList.isEmpty()) {
                filterList = new ArrayList<>();
            }
            filterList.add(filter);
        }
    }
312939
public int filterObject(CaptureSearchResult o) {
		if(client != null) {
			String url = o.getOriginalUrl();
			Date capDate = o.getCaptureDate();
			try {
				Rule r = client.getRule(url, capDate, new Date(), who);
				if(r != null) {
					String publicComment = r.getPublicComment();
					o.putCustom("ANOTATION", publicComment);
				}
			} catch (RuleOracleUnavailableException e) {
				e.printStackTrace();
				// should not happen: we forcibly disable robots retrievals 
			}
		}
		return FILTER_INCLUDE;
	}
885785
public void addFilter(Filter filter, Object value) {
        if (filter.getParameterClass().isInstance(value)) {
           parameters.put(filter.repr(), value);
        } else {
            String msg = "You need to supply the correct parameter for the " +
                    filter + " filter. Expecting a(n) " + filter.getParameterClass().getSimpleName();
            throw new FilterParameterException(msg);
        }
    }
515244
def filter_queryset(self, request, queryset, view):
        
        self.request = request
        self.view = view

        # enable addition of extra filters (i.e., a Q())
        # so custom filters can be added to the queryset without
        # running into https://code.djangoproject.com/ticket/18437
        # which, without this, would mean that filters added to the queryset
        # after this is called may not behave as expected
        extra_filters = self.view.get_extra_filters(request)

        disable_prefetches = self.view.is_update()

        self.DEBUG = settings.DEBUG

        return self._build_queryset(
            queryset=queryset,
            extra_filters=extra_filters,
            disable_prefetches=disable_prefetches,
        )
1248978
private void add(ClassFilter filter) {
        switch(operator) {
        case NOT:
            filters.add(new NegationClassFilter(filter));
            operator = Operator.NONE;
            break;
        case OR:
            filters.set(filters.size() - 1, 
                        new OrClassFilter(filters.get(filters.size() - 1), filter));
            operator = Operator.NONE;
            break;
        default:
            filters.add(filter);
            break;
        }
    }
950639
def result_object(index)
      klass = "Udongo::Search::ResultObjects::#{namespace}::#{index.searchable_type}"
      klass = 'Udongo::Search::ResultObjects::Base' unless result_object_exists?(klass)
      klass.constantize.new(index, search_context: self)
    end
771760
def add_filter(self, ftype, func):
        '''  '''
        if not isinstance(ftype, type):
            raise TypeError("Expected type object, got %s" % type(ftype))
        self.castfilter = [(t, f) for (t, f) in self.castfilter if t != ftype]
        self.castfilter.append((ftype, func))
        self.castfilter.sort()
494824
def where(filters)
      raise ModelNotFilterableError, model unless model.filterable?

      self.class.new(model: model, api: api, constraints: constraints.merge(where: filters))
    end
678123
def rest_add_filters(self, data):
        
        for _filter in data:
            filter_class = map_args_filter.get(_filter["opr"], None)
            if filter_class:
                self.add_filter(_filter["col"], filter_class, _filter["value"])
1046514
private void newFilter() {
        RowFilter<MyTableModel, Object> rf = null;
        //If current expression doesn't parse, don't update.
        try {
            rf = RowFilter.regexFilter(filterText.getText(), 0);
        } catch (java.util.regex.PatternSyntaxException e) {
            return;
        }
        sorter.setRowFilter(rf);
    }