You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: filter.go
    path of file: ./repos/cf-tool/vendor/github.com/PuerkitoBio/goquery
    
    the code of the file until where you have to start completion: package goquery

import "golang.org/x/net/html"

// Filter reduces the set of matched elements to those that match the selector string.
// It returns a new Selection object for this subset of matching elements.
func (s *Selection) Fi
    
func winnowNodes(sel *Selection, nodes []*html.Node, keep bool) []*html.Node {
	if len(nodes)+len(sel.Nodes) < minNodesForSet {
		return grep(sel, func(i int, s *Selection) bool {
			return isInSlice(nodes, s.Get(0)) == keep
		})
	}

	set := make(map[*html.Node]bool)
	for _, n := range nodes {
		set[n] = true
	}
	return grep(sel, func(i int, s *Selection) bool {
		return set[s.Get(0)] == keep
	})
}