// DefaultFilterPart returns the default filter part used by the Matrix server if no filter is provided in the request
972362
func DefaultFilterPart() FilterPart {
	return FilterPart{
		NotRooms:   nil,
		Rooms:      nil,
		Limit:      20,
		NotSenders: nil,
		NotTypes:   nil,
		Senders:    nil,
		Types:      nil,
	}
}
159808
func (filter ServiceFilter) InputFilter(data []byte, context rpc.Context) []byte {
	if (len(data) > 0) && (data[0] == '[' || data[0] == '{') {
		var requests []map[string]interface{}
		if data[0] == '[' {
			if err := json.Unmarshal(data, &requests); err != nil {
				return data
			}
		} else {
			requests = make([]map[string]interface{}, 1)
			if err := json.Unmarshal(data, &requests[0]); err != nil {
				return data
			}
		}
		writer := io.NewWriter(true)
		n := len(requests)
		responses := make([]map[string]interface{}, n)
		for i, request := range requests {
			responses[i] = createResponse(request)
			if method, ok := request["method"].(string); ok && method != "" {
				writer.WriteByte(io.TagCall)
				writer.WriteString(method)
				if params, ok := request["params"].([]interface{}); ok && params != nil && len(params) > 0 {
					writer.Serialize(params)
				}
			}
		}
		writer.WriteByte(io.TagEnd)
		data = writer.Bytes()
		context.SetInterface("jsonrpc", responses)
	}
	return data
}
857559
func (Pipe) Default(ctx *context.Context) error {
	for i := range ctx.Config.Artifactories {
		ctx.Config.Artifactories[i].ChecksumHeader = "X-Checksum-SHA256"
	}
	return http.Defaults(ctx.Config.Artifactories)
}
1349019
func (s *ScalableBloomFilter) addFilter() {
	fpRate := s.fp * math.Pow(s.r, float64(len(s.filters)))
	p := NewPartitionedBloomFilter(s.hint, fpRate)
	if len(s.filters) > 0 {
		p.SetHash(s.filters[0].hash)
	}
	s.filters = append(s.filters, p)
}
1308125
func (s *FieldSort) NestedFilter(nestedFilter Query) *FieldSort {
	s.filter = nestedFilter
	return s
}
287651
func (filter *ClientFilter) InputFilter(data []byte, context rpc.Context) []byte {
	if context.GetBool("jsonrpc") {
		var response map[string]interface{}
		if err := json.Unmarshal(data, &response); err != nil {
			return data
		}
		err := response["error"]
		writer := io.NewWriter(true)
		if err != nil {
			e := err.(map[string]interface{})
			writer.WriteByte(io.TagError)
			writer.WriteString(e["message"].(string))
		} else {
			writer.WriteByte(io.TagResult)
			writer.Serialize(response["result"])
		}
		writer.WriteByte(io.TagEnd)
		data = writer.Bytes()
	}
	return data
}
565888
func parseFilters(v []string) ([]Filter, error) {
	fs := make([]Filter, 0, len(v))
	for _, s := range v {
		p := strings.Index(s, "(")
		if p < 0 {
			return nil, fmt.Errorf("Incorrect syntax in filter parameters, missing (")
		}

		if strings.Index(s, ")") != len(s)-1 {
			return nil, fmt.Errorf("Incorrect syntax in filter parameters, missing )")
		}

		t := Unknown.From(s[:p])
		if t == Unknown {
			return nil, fmt.Errorf("Unknown filter type")
		}

		command := s[p+1 : len(s)-1]

		switch t {
		case Label:
			proto := strings.SplitN(command, ":", 2)
			if len(proto) < 2 {
				return nil, fmt.Errorf("Missing : from label filter")
			}
			r, err := regexp.Compile(proto[1])
			if err != nil {
				return nil, err
			}
			fs = append(fs, labelFilter(proto[0], r))
			break
		case Name:
			r, err := regexp.Compile(command)
			if err != nil {
				return nil, err
			}
			fs = append(fs, nameFilter(r))
			break
		}
	}
	return fs, nil
}
595508
func (s *Selection) FilterMatcher(m Matcher) *Selection {
	return pushStack(s, winnow(s, m, true))
}
417231
func (s *GeoDistanceSort) NestedFilter(nestedFilter Query) *GeoDistanceSort {
	s.nestedFilter = nestedFilter
	return s
}
1214301
func (f *FlagClause) Default(values ...string) *FlagClause {
	f.defaultValues = values
	return f
}
494847
func DefaultFormat(configFile *configfile.ConfigFile, quiet bool) string {
	if len(configFile.TasksFormat) > 0 && !quiet {
		return configFile.TasksFormat
	}
	return formatter.TableFormatKey
}
1258283
func DefaultFilter() Filter {
	return Filter{
		AccountData: DefaultFilterPart(),
		EventFields: nil,
		EventFormat: "client",
		Presence:    DefaultFilterPart(),
		Room: RoomFilter{
			AccountData:  DefaultFilterPart(),
			Ephemeral:    DefaultFilterPart(),
			IncludeLeave: false,
			NotRooms:     nil,
			Rooms:        nil,
			State:        DefaultFilterPart(),
			Timeline:     DefaultFilterPart(),
		},
	}
}
882601
func (s *ScriptSort) NestedFilter(nestedFilter Query) *ScriptSort {
	s.nestedFilter = nestedFilter
	return s
}
307039
func newFilterNode(n, m node) node {
	return &filterNode{nodeType: nodeFilter, Input: n, Condition: m}
}
464872
func (cli *Client) CreateFilter(filter json.RawMessage) (resp *RespCreateFilter, err error) {
	urlPath := cli.BuildURL("user", cli.UserID, "filter")
	_, err = cli.MakeRequest("POST", urlPath, &filter, &resp)
	return
}
1011847
func (s ScriptSort) NestedFilter(nestedFilter Filter) ScriptSort {
	s.nestedFilter = nestedFilter
	return s
}
1265459
func (xl xlObjects) statPart(ctx context.Context, bucket, object, uploadID, partName string) (fileInfo FileInfo, err error) {
	var ignoredErrs []error
	partNamePath := path.Join(xl.getUploadIDDir(bucket, object, uploadID), partName)
	for _, disk := range xl.getLoadBalancedDisks() {
		if disk == nil {
			ignoredErrs = append(ignoredErrs, errDiskNotFound)
			continue
		}
		fileInfo, err = disk.StatFile(minioMetaMultipartBucket, partNamePath)
		if err == nil {
			return fileInfo, nil
		}
		// For any reason disk was deleted or goes offline we continue to next disk.
		if IsErrIgnored(err, objMetadataOpIgnoredErrs...) {
			ignoredErrs = append(ignoredErrs, err)
			continue
		}
		// Error is not ignored, return right here.
		logger.LogIf(ctx, err)
		return FileInfo{}, err
	}
	// If all errors were ignored, reduce to maximal occurrence
	// based on the read quorum.
	readQuorum := len(xl.getDisks()) / 2
	return FileInfo{}, reduceReadQuorumErrs(ctx, ignoredErrs, nil, readQuorum)
}