// NewMultiHandler constructs a MultiHandler from a mapping of labels
// to signers and the default label.
164368
func NewMultiHandler(signers map[string]signer.Signer, defaultLabel string) (http.Handler, error) {
	return &api.HTTPHandler{
		Handler: &MultiHandler{
			signers:      signers,
			defaultLabel: defaultLabel,
		},
		Methods: []string{"POST"},
	}, nil
}
636927
func NewHandler(dispatcher *yarpc.Dispatcher, opts ...Option) http.HandlerFunc {
	return newHandler(dispatcher, opts...).handle
}
458697
func newChaincodeHandler(peerChatStream PeerChaincodeStream, chaincode Chaincode) *Handler {
	v := &Handler{
		ChatStream: peerChatStream,
		cc:         chaincode,
	}
	v.responseChannel = make(map[string]chan pb.ChaincodeMessage)
	v.state = created
	return v
}
498575
func NewMultiTimings(name string, labels []string) *MultiTimings {
	t := &MultiTimings{
		Timings: Timings{histograms: make(map[string]*Histogram)},
		labels:  labels,
	}
	if name != "" {
		Publish(name, t)
	}
	return t
}
493999
func NewMultiPolygon(coordinates []MultiLine) *MultiPolygon {
	if coordinates == nil {
		coordinates = make([]MultiLine, 0, INIT_GEOM_CAP)
	}
	return &MultiPolygon{Type: "MultiPolygon", Coordinates: coordinates}
}
1355060
func (h *CompositeMultiHandler) SetHandlers(handler LogHandler, options *LogOptions) {
	if len(options.Levels) == 0 {
		options.Levels = LvlAllList
	}

	// Set all levels
	for _, lvl := range options.Levels {
		h.SetHandler(handler, options.ReplaceExistingHandler, lvl)
	}

}
118067
func NewHandlerFromSigner(signer signer.Signer) (h *api.HTTPHandler, err error) {
	policy := signer.Policy()
	if policy == nil {
		err = errors.New(errors.PolicyError, errors.InvalidPolicy)
		return
	}

	// Sign will only respond for profiles that have no auth provider.
	// So if all of the profiles require authentication, we return an error.
	haveUnauth := (policy.Default.Provider == nil)
	for _, profile := range policy.Profiles {
		haveUnauth = haveUnauth || (profile.Provider == nil)
	}

	if !haveUnauth {
		err = errors.New(errors.PolicyError, errors.InvalidPolicy)
		return
	}

	return &api.HTTPHandler{
		Handler: &Handler{
			signer: signer,
		},
		Methods: []string{"POST"},
	}, nil
}
684168
func NewMultiProvider(providers ...PersistentProvider) *multiProvider {
	return &multiProvider{
		logger:    log.NewNopLogger(),
		providers: providers,
	}
}
1035598
func NewMultiWriteCloser(writeClosers ...io.WriteCloser) io.WriteCloser {
	writers := make([]io.Writer, len(writeClosers))
	for i, w := range writeClosers {
		writers[i] = w
	}
	return multiWriteCloser{Writer: io.MultiWriter(writers...), closers: writeClosers}
}
150588
func NewMultiCountersFunc(name string, labels []string, f CountersFunc) *MultiCountersFunc {
	t := &MultiCountersFunc{
		CountersFunc: f,
		labels:       labels,
	}
	if name != "" {
		Publish(name, t)
	}
	return t
}
1347324
func NewMultiwatcher(all *storeManager) *Multiwatcher {
	// Note that we want to be clear about the defaults. So we set zero
	// values explicitly.
	//  used:    false means that the watcher has not been used yet
	//  revno:   0 means that *all* transactions prior to the first
	//           Next() call will be reflected in the deltas.
	//  stopped: false means that the watcher immediately starts off
	//           handling changes.
	return &Multiwatcher{
		all:     all,
		used:    false,
		revno:   0,
		stopped: false,
	}
}
1287368
func NewQuarantineXattrHandler(node libkbfs.Node, folder *Folder,
) XattrHandler {
	return &QuarantineXattrHandler{
		node:   node,
		folder: folder,
	}
}
318646
func NewMultiPoint(coordinates Coordinates) *MultiPoint {
	if coordinates == nil {
		coordinates = make(Coordinates, 0, INIT_GEOM_CAP)
	}
	return &MultiPoint{Type: "MultiPoint", Coordinates: coordinates}
}
389214
func (c Core) NewMultipartUpload(bucket, object string, opts PutObjectOptions) (uploadID string, err error) {
	result, err := c.initiateMultipartUpload(context.Background(), bucket, object, opts)
	return result.UploadID, err
}
1352543
func NewMultiRoutineRunner(num int) *MultiRoutineRunner {
	if num <= 0 {
		panic("number of routines must be positive")
	}
	return &MultiRoutineRunner{
		num: num,
		q:   make(chan func(), num),
	}
}
1165957
func NewMultiErr(errs []error) error {
	retErrs := make([]error, 0, len(errs))
	for _, err := range errs {
		if err != nil {
			retErrs = append(retErrs, err)
		}
	}
	if len(retErrs) == 0 {
		return nil
	}
	if len(retErrs) == 1 {
		return retErrs[0]
	}
	return &MultiErr{
		errs: retErrs,
	}
}
1080454
func NewMethodHandler(handler interface{}, defaultCode int) *MethodHandler {
	return &MethodHandler{
		DefaultCode: defaultCode,
		Handler:     handler,
	}
}