Write the <filters> element.
336112
def write_filters(*filters) #:nodoc:
      if filters.size == 1 && filters[0] == 'blanks'
        # Special case for blank cells only.
        @writer.empty_tag('filters', [ ['blank', 1] ])
      else
        # General case.
        @writer.tag_elements('filters') do
          filters.each { |filter| write_filter(filter) }
        end
      end
    end
192729
public function write()
    {
        foreach ($this->parameters as $prop => $value) {
            $placeHolders[] = sprintf('<%s>', $prop);
            $replacements[] = $value;
        }

        $content = str_replace($placeHolders, $replacements, self::$template);

        fwrite($this->file, $this->addHeaders($content));
    }
1071063
public static void filteredCounterWrite(String member, Predicate<String> includeFilter,
      Predicate<String> includeCounterFilter,
      CounterMap counterMap, JsonGenerator jsonGenerator)
      throws IOException {
    if (includeFilter != null && includeCounterFilter == null) {
      if (includeFilter.apply(member)) {
        jsonGenerator.writeFieldName(member);
        jsonGenerator.writeObject(counterMap);
      }
    } else {
      if (includeCounterFilter != null) {
        // get group name, counter name,
        // check if it is wanted
        // if yes print it.
        boolean startObjectGroupMap = false;
        jsonGenerator.writeFieldName(member);

        String fullCounterName;
        jsonGenerator.writeStartObject();

        for (String group : counterMap.getGroups()) {
          Map<String, Counter> groupMap = counterMap.getGroup(group);
          for (Map.Entry<String, Counter> nameCounterEntry : groupMap.entrySet()) {
            Counter counter = nameCounterEntry.getValue();
            fullCounterName = group + "." + counter.getKey();
            if (includeCounterFilter.apply(fullCounterName)) {
              if (startObjectGroupMap == false) {
                jsonGenerator.writeFieldName(group);
                jsonGenerator.writeStartObject();
                startObjectGroupMap = true;
              }
              jsonGenerator.writeFieldName(counter.getKey());
              jsonGenerator.writeNumber(counter.getValue());
            }
          }
          if (startObjectGroupMap) {
            jsonGenerator.writeEndObject();
            startObjectGroupMap = false;
          }
        }
        jsonGenerator.writeEndObject();
      }
    }
  }
945743
function( writer, filter )
	{
		var comment = this.value;

		if ( filter )
		{
			if ( !( comment = filter.onComment( comment, this ) ) )
				return;

			if ( typeof comment != 'string' )
			{
				comment.parent = this.parent;
				comment.writeHtml( writer, filter );
				return;
			}
		}

		writer.comment( comment );
	}
1019790
@Override
    public WritableBlobContainerContract withFilter(ServiceFilter filter) {
        MediaBlobContainerWriter mediaBlobContainerWriter = new MediaBlobContainerWriter(
                this, filter);
        return mediaBlobContainerWriter;
    }
547329
public static void addFilter(Document doc, Element root) {
    Element filter = doc.createElement("filter");
    Element filterName = doc.createElement("filter-name");
    filterName.appendChild(doc.createTextNode("ShiroFilter"));
    filter.appendChild(filterName);
    Element filterClass = doc.createElement("filter-class");
    filterClass.appendChild(doc
        .createTextNode("org.apache.shiro.web.servlet.ShiroFilter"));
    filter.appendChild(filterClass);

    addRelativeTo(root, filter, "filter", true);
  }
528195
public function applyFilters()
    {
        if ($this->filters) {
            foreach ($this->filters as $k => $filter) {
                if (
                    isset($_GET[$filter['field']]) &&
                    !empty($_GET[$filter['field']]) &&
                    $_GET[$filter['field']] != $this->filterEmpty &&
                    @$_GET['filter'] != $filter['field']
                ) {
                    $this->model->addCondition($filter['field'], $_GET[$filter['field']]);
                }
            }
        }
    }
1185032
private boolean passesFilters(Level3Element ele)
	{
		if (filters == null) return true;

		for (Filter filter : filters)
		{
			if (!filter.okToTraverse(ele)) return false;
		}
		return true;
	}
87914
private void applyFilter(){
        filteredItems.clear();

        Filter<M> filter = getFilter();
        if(filter == null){
            filteredItems.addAll(items);
        }else{
            for (int i = 0; i < items.size(); i++) {
                M item = items.get(i);
                if(filter.filter(item, query)){
                    filteredItems.add(item);
                }
            }
        }

        onFiltered();
    }
1109750
void filterTree(String filter) {

        HierarchicalContainer container = (HierarchicalContainer)m_tree.getContainerDataSource();
        container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            final String lowerCaseFilter = filter.toLowerCase();
            container.addContainerFilter(new Filter() {

                private static final long serialVersionUID = 1L;

                public boolean appliesToProperty(Object propertyId) {

                    return true;
                }

                public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {

                    CmsCategory cat = (CmsCategory)itemId;

                    return cat.getPath().toLowerCase().contains(lowerCaseFilter)
                        || ((cat.getTitle() != null) && cat.getTitle().toLowerCase().contains(lowerCaseFilter));
                }
            });
        }
    }
351639
void setFilters(Map<Object, Object> filters) {

        for (Object column : filters.keySet()) {
            Object filterValue = filters.get(column);
            if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {
                m_table.setFilterFieldValue(column, filterValue);
            }
        }
    }
1059002
function (aElements, fnFilter, fnFormat) {
				var i,
					iLength = aElements.length,
					aNewElements = [],
					oElement;

				for (i = 0; i < iLength; i++) {
					oElement = aElements[i];

					if (fnFilter && !fnFilter(oElement)) {
						continue;
					}
					if (fnFormat) {
						fnFormat(oElement);
					}
					aNewElements.push(oElement);
				}
				return aNewElements;
			}
276309
static Element buildFilterElement(String filterName, String filterGUID)
	{
		Element filter = new Element(filterName);
		Element module = new Element("Module_0");
		filter.addContent(module);

		module.setAttribute("PresetGUID", filterGUID);

		return filter;
	}
611718
function filterElement( element, parentName, isFirst, isLast ) {
			var nodes = filterElementInner( element, parentName ),
				nodes2 = [],
				nodesCount = nodes.length,
				nodeIndex = 0,
				node,
				afterSpace = 0,
				lastSpaceIndex = -1;

			// Remove duplicated spaces and spaces at the:
			// * beginnig if filtered element isFirst (isFirst that's going to be inserted)
			// * end if filtered element isLast.
			for ( ; nodeIndex < nodesCount; nodeIndex++ ) {
				node = nodes[ nodeIndex ];

				if ( node == ' ' ) {
					// Don't push doubled space and if it's leading space for insertion.
					if ( !afterSpace && !( isFirst && !nodeIndex ) ) {
						nodes2.push( new CKEDITOR.dom.text( ' ' ) );
						lastSpaceIndex = nodes2.length;
					}
					afterSpace = 1;
				} else {
					nodes2.push( node );
					afterSpace = 0;
				}
			}

			// Remove trailing space.
			if ( isLast && lastSpaceIndex == nodes2.length )
				nodes2.pop();

			return nodes2;
		}
1312777
private void addFilter(Filter filter) {
        boolean exists = false;
        for (Filter initedFilter : this.filters) {
            if (initedFilter.getClass() == filter.getClass()) {
                exists = true;
                break;
            }
        }

        if (!exists) {
            filter.init(this);
            this.filters.add(filter);
        }

    }
1249031
def _build_filters(_filters):
    
    root = utils.NestedDict({})
    for _filter in _filters:
        operation = None
        for operation, token in SPLIT_TOKENS:
            # split "some.key=value" into ["some.key", "value"]
            top_parts = _filter.split(token, 1)
            if len(top_parts) == 2:
                break
        else:
            raise exceptions.CLIAbort('Failed to find valid operation for: %s'
                                      % _filter)

        key, value = top_parts
        current = root
        # split "some.key" into ["some", "key"]
        parts = [part.strip() for part in key.split('.')]

        # Actually drill down and add the filter
        for part in parts[:-1]:
            current = current[part]

        if operation == 'eq':
            current[parts[-1]] = utils.query_filter(value.strip())
        elif operation == 'in':
            current[parts[-1]] = {
                'operation': 'in',
                'options': [{
                    'name': 'data',
                    'value': [p.strip() for p in value.split(',')],
                }],
            }

    return root.to_dict()
44952
function( writer, filter )
		{
			var text = this.value;

			if ( filter && !( text = filter.onText( text, this ) ) )
				return;

			writer.text( text );
		}