// Process to implement ContentTreatmentInterface
967956
func (cc *CoffeeCompiler) Process(content []byte, path string) (ret []byte, err error) {
	//Multithread safety first!
	cc.mutex.Lock()
	defer cc.mutex.Unlock()
	ctx := cc.jsvm
	ctx.EvalString("(function(content, path){CompileError = ''; try {return CoffeeScript.compile(content, {filename: path});} catch(e) {CompiledError = e.toString(); return e}})")
	ctx.DumpFunction()
	ctx.LoadFunction()
	ctx.PushString(string(content))
	ctx.PushString(path)
	ctx.Call(2)
	if ctx.GetErrorCode(-1) != 0 {
		ctx.EvalString("CompiledError")
		err = errors.New(ctx.GetString(-1))
		ctx.Pop()
	} else {
		ret = []byte(ctx.GetString(-1))
	}
	ctx.Pop()
	return
}
815642
func ProcessOCItoGRPC(ociProcess *specs.Process) (*Process, error) {
	s := &Process{}

	err := copyStruct(s, ociProcess)

	return s, err
}
472066
func process(workload Workload, result *Result) (err error) {

	c := make(chan int, len(workload.Requests))
	result.Responses = make([]Response, len(workload.Requests))

	for index, _ := range workload.Requests {

		if workload.UseHeaders {
			replaceHeaderValues(&workload.Requests[index].Header, &workload.header)
		}

		if workload.StrictOrder {
			syncRequest(&workload.Requests[index], &result.Responses[index])
		} else {
			go asyncRequest(&workload.Requests[index], &result.Responses[index], c)
		}
	}

	// if async, wait for our responses or timeout
	if !workload.StrictOrder {

		// create a timeout so we don't wait forever
		var timeout <-chan time.Time

		if workload.Timeout > 0 {
			timeout = time.After(time.Duration(workload.Timeout))
		} else {
			timeout = time.After(DefaultTimeout)
		}

		for index := 0; index < len(workload.Requests); index++ {
			select {
			case <-c:
			case <-timeout:
				log.Warn("[process] Timed out waiting for all go routines to complete")
				break
			}
		}
	}
	return
}
1112919
func processSvcProviderUpdEvent(netPlugin *plugin.NetPlugin, svcProvider *mastercfg.SvcProvider, isDelete bool) error {
	if isDelete {
		//ignore delete event since servicelb delete will take care of this.
		return nil
	}
	netPlugin.SvcProviderUpdate(svcProvider.ServiceName, svcProvider.Providers)
	return nil
}
19807
func (prc *Processor) Process(nim image.Image, params imageserver.Params) (image.Image, error) {
	if !params.Has(param) {
		return nim, nil
	}
	params, err := params.GetParams(param)
	if err != nil {
		return nil, err
	}
	if params.Empty() {
		return nim, nil
	}
	nim, err = prc.process(nim, params)
	if err != nil {
		if err, ok := err.(*imageserver.ParamError); ok {
			err.Param = fmt.Sprintf("%s.%s", param, err.Param)
		}
		return nil, err
	}
	return nim, nil
}
626497
func processEvents(inboundEvents chan []byte, parsedEvents chan *Event) {
	go func(inboundEvents chan []byte, parsedEvents chan *Event) {
		for event := range inboundEvents {
			var e Event
			json.Unmarshal(event, &e)
			parsedEvents <- &e
		}
	}(inboundEvents, parsedEvents)
}
1318632
func (f *auto_complete_file) process_data(data []byte) {
	cur, filedata, block := rip_off_decl(data, f.cursor)
	file, err := parser.ParseFile(f.fset, "", filedata, parser.AllErrors)
	if err != nil && *g_debug {
		log_parse_error("Error parsing input file (outer block)", err)
	}
	f.package_name = package_name(file)

	f.decls = make(map[string]*decl)
	f.packages = collect_package_imports(f.name, file.Decls, f.context)
	f.filescope = new_scope(nil)
	f.scope = f.filescope

	for _, d := range file.Decls {
		anonymify_ast(d, 0, f.filescope)
	}

	// process all top-level declarations
	for _, decl := range file.Decls {
		append_to_top_decls(f.decls, decl, f.scope)
	}
	if block != nil {
		// process local function as top-level declaration
		decls, err := parse_decl_list(f.fset, block)
		if err != nil && *g_debug {
			log_parse_error("Error parsing input file (inner block)", err)
		}

		for _, d := range decls {
			anonymify_ast(d, 0, f.filescope)
		}

		for _, decl := range decls {
			append_to_top_decls(f.decls, decl, f.scope)
		}

		// process function internals
		f.cursor = cur
		for _, decl := range decls {
			f.process_decl_locals(decl)
		}
	}

}
1352464
func (f *processState) Process(event Event) {
	switch event.Name {
	// Ready event means Teleport has started successfully.
	case TeleportReadyEvent:
		atomic.StoreInt64(&f.currentState, stateOK)
		f.process.Infof("Detected that service started and joined the cluster successfully.")
	// If a degraded event was received, always change the state to degraded.
	case TeleportDegradedEvent:
		atomic.StoreInt64(&f.currentState, stateDegraded)
		f.process.Infof("Detected Teleport is running in a degraded state.")
	// If the current state is degraded, and a OK event has been
	// received, change the state to recovering. If the current state is
	// recovering and a OK events is received, if it's been longer
	// than the recovery time (2 time the server keep alive ttl), change
	// state to OK.
	case TeleportOKEvent:
		switch atomic.LoadInt64(&f.currentState) {
		case stateDegraded:
			atomic.StoreInt64(&f.currentState, stateRecovering)
			f.recoveryTime = f.process.Clock.Now()
			f.process.Infof("Teleport is recovering from a degraded state.")
		case stateRecovering:
			if f.process.Clock.Now().Sub(f.recoveryTime) > defaults.ServerKeepAliveTTL*2 {
				atomic.StoreInt64(&f.currentState, stateOK)
				f.process.Infof("Teleport has recovered from a degraded state.")
			}
		}
	}
}
1111267
func (d *Downloader) processFullSyncContent() error {
	for {
		results := d.queue.Results(true)
		if len(results) == 0 {
			return nil
		}
		if d.chainInsertHook != nil {
			d.chainInsertHook(results)
		}
		if err := d.importBlockResults(results); err != nil {
			return err
		}
	}
}
932071
func (f *filter) ProcessProposal(ctx context.Context, signedProp *peer.SignedProposal) (*peer.ProposalResponse, error) {
	return f.next.ProcessProposal(ctx, signedProp)
}
398552
func (md *MDOpsStandard) processMetadata(ctx context.Context,
	handle *tlfhandle.Handle, rmds *RootMetadataSigned, extra kbfsmd.ExtraMetadata,
	getRangeLock *sync.Mutex) (ImmutableRootMetadata, error) {
	// First, construct the ImmutableRootMetadata object, even before
	// we validate the writer or the keys, because the irmd will be
	// used in that process to check for valid successors.

	// Get the UID unless this is a public tlf - then proceed with empty uid.
	var uid keybase1.UID
	if handle.Type() != tlf.Public {
		session, err := md.config.KBPKI().GetCurrentSession(ctx)
		if err != nil {
			return ImmutableRootMetadata{}, err
		}
		uid = session.UID
	}

	// TODO: Avoid having to do this type assertion.
	brmd, ok := rmds.MD.(kbfsmd.MutableRootMetadata)
	if !ok {
		return ImmutableRootMetadata{}, kbfsmd.MutableRootMetadataNoImplError{}
	}

	rmd := makeRootMetadata(brmd, extra, handle)
	// Try to decrypt using the keys available in this md.  If that
	// doesn't work, a future MD may contain more keys and will be
	// tried later.
	pmd, err := decryptMDPrivateData(
		ctx, md.config.Codec(), md.config.Crypto(),
		md.config.BlockCache(), md.config.BlockOps(),
		md.config.KeyManager(), md.config.KBPKI(), md.config, md.config.Mode(),
		uid, rmd.GetSerializedPrivateMetadata(), rmd, rmd, md.log)
	if err != nil {
		return ImmutableRootMetadata{}, err
	}
	rmd.data = pmd

	mdID, err := kbfsmd.MakeID(md.config.Codec(), rmd.bareMd)
	if err != nil {
		return ImmutableRootMetadata{}, err
	}

	localTimestamp := rmds.untrustedServerTimestamp
	mdserv, err := md.mdserver(ctx)
	if err != nil {
		return ImmutableRootMetadata{}, err
	}
	if offset, ok := mdserv.OffsetFromServerTime(); ok {
		localTimestamp = localTimestamp.Add(offset)
	}

	key := rmds.GetWriterMetadataSigInfo().VerifyingKey
	irmd := MakeImmutableRootMetadata(rmd, key, mdID, localTimestamp, true)

	// Next, verify validity and signatures.  Use a checker that can
	// check for writership in the past, using the merkle tree.
	checker := merkleBasedTeamChecker{md.config.KBPKI(), md, rmds, irmd, false}
	err = rmds.IsValidAndSigned(
		ctx, md.config.Codec(), checker, extra,
		md.config.OfflineAvailabilityForID(handle.TlfID()))
	if err != nil {
		return ImmutableRootMetadata{}, MDMismatchError{
			rmds.MD.RevisionNumber(), handle.GetCanonicalPath(),
			rmds.MD.TlfID(), err,
		}
	}

	// Then, verify the verifying keys.  We do this after decrypting
	// the MD and making the ImmutableRootMetadata, since we may need
	// access to the private metadata when checking the merkle roots,
	// and we also need access to the `mdID`.
	if err := md.verifyWriterKey(
		ctx, rmds, irmd, handle, getRangeLock); err != nil {
		return ImmutableRootMetadata{}, err
	}

	cacheable, err := md.verifyKey(
		ctx, rmds, rmds.MD.GetLastModifyingUser(), rmds.SigInfo.VerifyingKey,
		irmd)
	if err != nil {
		return ImmutableRootMetadata{}, md.convertVerifyingKeyError(
			ctx, rmds, handle, err)
	}

	// Make sure the caller doesn't use rmds anymore.
	*rmds = RootMetadataSigned{}

	if cacheable && !checker.notCacheable {
		err = md.config.MDCache().Put(irmd)
		if err != nil {
			return ImmutableRootMetadata{}, err
		}
	}
	return irmd, nil
}
988498
func (s *Server) ServeHTTP(c http.ResponseWriter, req *http.Request) {
	s.Process(c, req)
}
1271626
func (c *ChtIndexerBackend) Process(ctx context.Context, header *types.Header) error {
	hash, num := header.Hash(), header.Number.Uint64()
	c.lastHash = hash

	td := rawdb.ReadTd(c.diskdb, hash, num)
	if td == nil {
		panic(nil)
	}
	var encNumber [8]byte
	binary.BigEndian.PutUint64(encNumber[:], num)
	data, _ := rlp.EncodeToBytes(ChtNode{hash, td})
	c.trie.Update(encNumber[:], data)
	return nil
}
224966
func (s *ServiceController) processServiceDeletion(key string) error {
	cachedService, ok := s.cache.get(key)
	if !ok {
		klog.Errorf("service %s not in cache even though the watcher thought it was. Ignoring the deletion", key)
		return nil
	}
	return s.processLoadBalancerDelete(cachedService, key)
}
1156635
func (fhc *FakeHttpClient) processResponse() ([]byte, int, error) {
	fhc.DoRawHttpRequestResponsesCount += 1

	if fhc.DoRawHttpRequestError != nil {
		return []byte{}, fhc.DoRawHttpRequestInt, fhc.DoRawHttpRequestError
	}

	if fhc.DoRawHttpRequestResponses != nil && len(fhc.DoRawHttpRequestResponses) == 0 {
		return fhc.DoRawHttpRequestResponse, fhc.DoRawHttpRequestInt, fhc.DoRawHttpRequestError
	} else {
		fhc.DoRawHttpRequestResponsesIndex = fhc.DoRawHttpRequestResponsesIndex + 1
		return fhc.DoRawHttpRequestResponses[fhc.DoRawHttpRequestResponsesIndex-1], fhc.DoRawHttpRequestInt, fhc.DoRawHttpRequestError
	}
}
538651
func (p *Peer) ProcessTransactionProposal(ctx reqContext.Context, proposal fab.ProcessProposalRequest) (*fab.TransactionProposalResponse, error) {
	return p.processor.ProcessTransactionProposal(ctx, proposal)
}
499884
func (t *Task) Process(ctx context.Context, id string) (runtime.Process, error) {
	p := &Process{
		id: id,
		t:  t,
	}
	if _, err := p.State(ctx); err != nil {
		return nil, err
	}
	return p, nil
}