// Process implements Processor.
194677
func (f ProcessorFunc) Process(g *gif.GIF, params imageserver.Params) (*gif.GIF, error) {
	return f(g, params)
}
856516
func (h *RecorderHandler) Process(s nats.Subscription, m nats.Message) {
	defer m.Ack()
	collected := new(MetricsCollection)
	err := json.Unmarshal(m.Data(), &collected)
	if err != nil {
		h.Logger.Error("recorder handler error", zap.Error(err))
		return
	}
	err = h.Recorder.Record(*collected)
	if err != nil {
		h.Logger.Error("recorder handler error", zap.Error(err))
	}
}
82857
func Process(c http.ResponseWriter, req *http.Request) {
	mainServer.Process(c, req)
}
72781
func Process(pkg, outdir string, newType string, optset ...func(*Options)) error {
	opts := DefaultOptions
	for _, fn := range optset {
		fn(&opts)
	}

	p, err := findPackage(pkg)
	if err != nil {
		return err
	}

	if outdir == "" {
		outdir = path.Base(pkg)
	}

	if err := os.MkdirAll(outdir, os.ModePerm); err != nil {
		return err
	}

	t := parseTargetType(newType)

	files, err := processFiles(p, p.GoFiles, t)
	if err != nil {
		return err
	}

	if err := write(outdir, files); err != nil {
		return err
	}

	if opts.SkipTestFiles {
		return nil
	}

	files, err = processFiles(p, p.TestGoFiles, t)
	if err != nil {
		return err
	}

	return write(outdir, files)
}
1234662
func (rn *rawNode) ProcessWith(p Processor) error {
	return p.Raw(rn.raw)
}
1175689
func (p *Pss) process(pssmsg *PssMsg, raw bool, prox bool) error {
	metrics.GetOrRegisterCounter("pss.process", nil).Inc(1)

	var err error
	var recvmsg *whisper.ReceivedMessage
	var payload []byte
	var from PssAddress
	var asymmetric bool
	var keyid string
	var keyFunc func(envelope *whisper.Envelope) (*whisper.ReceivedMessage, string, PssAddress, error)

	envelope := pssmsg.Payload
	psstopic := Topic(envelope.Topic)

	if raw {
		payload = pssmsg.Payload.Data
	} else {
		if pssmsg.isSym() {
			keyFunc = p.processSym
		} else {
			asymmetric = true
			keyFunc = p.processAsym
		}

		recvmsg, keyid, from, err = keyFunc(envelope)
		if err != nil {
			return errors.New("Decryption failed")
		}
		payload = recvmsg.Payload
	}

	if len(pssmsg.To) < addressLength || prox {
		err = p.enqueue(pssmsg)
	}
	p.executeHandlers(psstopic, payload, from, raw, prox, asymmetric, keyid)
	return err
}
337120
func (p Process) Wait() (*os.ProcessState, error) {
	if p.ops == nil {
		return nil, newGenericError(fmt.Errorf("invalid process"), NoProcessOps)
	}
	return p.ops.wait()
}
344729
func (rpw *ReplicationWatcher) Process(ctx context.Context, dbconfigs *dbconfigs.DBConfigs) {
	defer func() {
		tabletenv.LogError()
		rpw.wg.Done()
	}()
	for {
		log.Infof("Starting a binlog Streamer from current replication position to monitor binlogs")
		streamer := binlog.NewStreamer(dbconfigs.DbaWithDB(), rpw.se, nil /*clientCharset*/, mysql.Position{}, 0 /*timestamp*/, func(eventToken *querypb.EventToken, statements []binlog.FullBinlogStatement) error {
			// Save the event token.
			rpw.mu.Lock()
			rpw.eventToken = eventToken
			rpw.mu.Unlock()

			// If it's a DDL, trigger a schema reload.
			for _, statement := range statements {
				if statement.Statement.Category != binlogdatapb.BinlogTransaction_Statement_BL_DDL {
					continue
				}
				err := rpw.se.Reload(ctx)
				log.Infof("Streamer triggered a schema reload, with result: %v", err)
				return nil
			}

			return nil
		})

		if err := streamer.Stream(ctx); err != nil {
			log.Infof("Streamer stopped: %v", err)
		}

		select {
		case <-ctx.Done():
			return
		case <-time.After(5 * time.Second):
		}
	}
}
403635
func (cn *commentNode) ProcessWith(p Processor) error {
	return p.Comment(cn.comment)
}
660002
func (prc *Processor) Process(nim image.Image, params imageserver.Params) (image.Image, error) {
	out := prc.newDrawable(nim)
	bd := nim.Bounds().Intersect(out.Bounds())
	at := imageutil.NewAtFunc(nim)
	set := imageutil.NewSetFunc(out)
	imageutil.Parallel1D(bd, func(bd image.Rectangle) {
		for y := bd.Min.Y; y < bd.Max.Y; y++ {
			for x := bd.Min.X; x < bd.Max.X; x++ {
				r, g, b, a := at(x, y)
				r, g, b, a = imageutil.RGBAToNRGBA(r, g, b, a)
				r = uint32(prc.vals[uint16(r)])
				g = uint32(prc.vals[uint16(g)])
				b = uint32(prc.vals[uint16(b)])
				r, g, b, a = imageutil.NRGBAToRGBA(r, g, b, a)
				set(x, y, r, g, b, a)
			}
		}
	})
	return out, nil
}
871756
func (r *RollupRouter) Process(logmsg map[string]interface{}) {
	if r.ctxDone {
		return
	}

	statusCode, ok := logmsg["status-code"].(int)
	if !ok {
		return
	}
	op, ok := logmsg["op"].(string)
	if !ok {
		return
	}
	httpMethod, ok := logmsg["method"].(string)
	if !ok {
		return
	}
	canary, ok := logmsg["canary"].(bool)
	if !ok {
		return
	}
	r.findOrCreate(statusCode, op, httpMethod, canary).add(logmsg)
}
1161314
func (f *Fragmentation) Process(id uint32, first, last uint16, more bool, vv buffer.VectorisedView) (buffer.VectorisedView, bool) {
	f.mu.Lock()
	r, ok := f.reassemblers[id]
	if ok && r.tooOld(f.timeout) {
		// This is very likely to be an id-collision or someone performing a slow-rate attack.
		f.release(r)
		ok = false
	}
	if !ok {
		r = newReassembler(id)
		f.reassemblers[id] = r
		f.rList.PushFront(r)
	}
	f.mu.Unlock()

	res, done, consumed := r.process(first, last, more, vv)

	f.mu.Lock()
	f.size += consumed
	if done {
		f.release(r)
	}
	// Evict reassemblers if we are consuming more memory than highLimit until
	// we reach lowLimit.
	if f.size > f.highLimit {
		tail := f.rList.Back()
		for f.size > f.lowLimit && tail != nil {
			f.release(tail)
			tail = tail.Prev()
		}
	}
	f.mu.Unlock()
	return res, done
}
1179097
func (tn *textNode) ProcessWith(p Processor) error {
	return p.Text(tn.text)
}
713165
func (ssc *ScssSassCompiler) Process(content []byte, path string) ([]byte, error) {
	in := bytes.NewBuffer(content)
	out := &bytes.Buffer{}
	comp, err := libsass.New(out, in, libsass.OutputStyle(libsass.Style["nested"]), libsass.Comments(ssc.LineNumbers || ssc.DebugInfo))
	if err != nil {
		return nil, err
	}
	if err := comp.Run(); err != nil {
		return nil, err
	}
	return bytes.TrimSpace(bytes.Replace(out.Bytes(), []byte("*filecompiler.SassCompiler"), make([]byte, 0), 1)), nil
}
96217
func (s *Secure) Process(w http.ResponseWriter, r *http.Request) error {
	responseHeader, _, err := s.processRequest(w, r)
	addResponseHeaders(responseHeader, w)

	return err
}
1210991
func Process(file string) (*raml.APIDefinition, error) {
	routes, err := raml.ParseFile(file)
	if err != nil {
		return nil, fmt.Errorf("Failed parsing RAML file: %s\n", err.Error())
	}
	return routes, nil
}
1187486
func Process(out io.Writer, in io.Reader, opts ...Option) error {
	e := embedder{Fetcher: fetcher{}}
	for _, opt := range opts {
		opt.f(&e)
	}
	return process(out, in, e.runCommand)
}