// Parse all results in the batch.  Add records to shared list.
// If the record was not found, the bins will be nil.
340950
func (cmd *batchCommandExists) parseRecordResults(ifc command, receiveSize int) (bool, error) {
	//Parse each message response and add it to the result array
	cmd.dataOffset = 0

	for cmd.dataOffset < receiveSize {
		if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil {
			return false, err
		}

		resultCode := ResultCode(cmd.dataBuffer[5] & 0xFF)

		// The only valid server return codes are "ok" and "not found".
		// If other return codes are received, then abort the batch.
		if resultCode != 0 && resultCode != KEY_NOT_FOUND_ERROR {
			return false, NewAerospikeError(resultCode)
		}

		info3 := cmd.dataBuffer[3]

		// If cmd is the end marker of the response, do not proceed further
		if (int(info3) & _INFO3_LAST) == _INFO3_LAST {
			return false, nil
		}

		batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14))
		fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18))
		opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20))

		if opCount > 0 {
			return false, NewAerospikeError(PARSE_ERROR, "Received bins that were not requested!")
		}

		key, err := cmd.parseKey(fieldCount)
		if err != nil {
			return false, err
		}

		var offset int
		offset = batchIndex

		if bytes.Equal(key.digest[:], cmd.keys[offset].digest[:]) {
			// only set the results to true; as a result, no synchronization is needed
			if resultCode == 0 {
				cmd.existsArray[offset] = true
			}
		} else {
			return false, NewAerospikeError(PARSE_ERROR, "Unexpected batch key returned: "+key.namespace+","+Buffer.BytesToHexString(key.digest[:])+". Expected: "+Buffer.BytesToHexString(cmd.keys[offset].digest[:]))
		}
	}
	return true, nil
}
1333959
func (p *Parser) Parse(filename string, r io.Reader) (*ast.Grammar, error) {
	p.errs.reset()
	p.s.Init(filename, r, p.errs.add)

	g := p.grammar()
	return g, p.errs.err()
}
1124616
func Parse(filename string, src io.Reader) (Grammar, error) {
	var p parser
	grammar := p.parse(filename, src)
	return grammar, p.errors.Err()
}
1343058
func (d *commandSyncDb) Parse(args []string) {
	var name string

	flagSet := flag.NewFlagSet("orm command: syncdb", flag.ExitOnError)
	flagSet.StringVar(&name, "db", "default", "DataBase alias name")
	flagSet.BoolVar(&d.force, "force", false, "drop tables before create")
	flagSet.BoolVar(&d.verbose, "v", false, "verbose info")
	flagSet.Parse(args)

	d.al = getDbAlias(name)
}
298492
func Parse(args ...string) (Value, error) {
	v, _, err := ParseWithAliases(args...)
	return v, err
}
786287
func (s *CloudControllerDeploymentParser) Parse(jsonObj []VMObject) ([]CCJob, error) {
	err := s.setupAndRun(jsonObj)
	return s.vms, err
}
88553
func Parse(data []byte, order binary.ByteOrder, staticBase uint64) FrameDescriptionEntries {
	var (
		buf  = bytes.NewBuffer(data)
		pctx = &parseContext{buf: buf, entries: NewFrameIndex(), staticBase: staticBase}
	)

	for fn := parselength; buf.Len() != 0; {
		fn = fn(pctx)
	}

	for i := range pctx.entries {
		pctx.entries[i].order = order
	}

	return pctx.entries
}
606142
func (e *Env) Parse() error {
	for _, name := range e.FieldNames() {
		field, _ := e.Value.Type().FieldByName(name)
		v, err := NewVar(field)

		if err != nil {
			return err
		}
		e.Value.FieldByName(name).Set(v.Value)
		e.Vars = append(e.Vars, v)
	}

	return nil
}
476823
func (l *Linode) Batch(action string, params Parameters, result interface{}) {
	params.Set(apiAction, action)
	l.actions = append(l.actions, Action{
		parameters: params,
		result:     result,
	})
}
860453
func Parse(filename string) (RootList, error) {
	cfgMap, err := ParseToRawMap(filename)
	if err != nil {
		return nil, err
	}

	var rootList = RootList{}
	for label, entries := range cfgMap {
		root, err := LoadRoot(entries)
		if err != nil {
			return nil, err
		}

		rootList[label] = root
	}

	return rootList, nil
}
832561
func (r *Reader) ReadAll() (records [][]string, err error) {
	for {
		record, err := r.Read()
		if err == io.EOF {
			return records, nil
		}
		if err != nil {
			return nil, err
		}
		records = append(records, record)
	}
}
259640
func (ini *INI) Parse(data []byte, lineSep, kvSep string) error {
    return ini.parseINI(data, lineSep, kvSep)
}
477986
func (b *Batch) QueryRowResults() *Row {
	rows, _ := b.QueryResults()
	return (*Row)(rows)

}
429372
func (d *Dir) Parse(newDir string) []string {
	list := strings.Split(newDir, "/")

	var dirWalk []string

	for indx := range list {
		dirList := ""
		for i := -1; i < indx; i++ {
			dirList += list[i+1] + "/"
		}

		if !d.Exists(dirList) {
			if strings.HasSuffix(dirList, "//") {
				dirList = dirList[:len(dirList)-1]
			}

			dirWalk = append(dirWalk, dirList)
			d.Blacklist = append(d.Blacklist, dirList)
		}
	}

	return dirWalk
}
69847
func Parse(query string) (*Ast, error) {
	l := lex.NewLexer(query, InfluxQlDialect)
	p := Parser{l: l, qryText: query}
	return p.parse()
}
553943
func (c *collectRun) summarizeResults(results []taskResult) ([]byte, error) {
	if c.taskSummaryPython {
		return summarizeResultsPython(results)
	}

	jsonResults := map[string]interface{}{}
	for _, result := range results {
		jsonResult := map[string]interface{}{}
		if result.err != nil {
			jsonResult["error"] = result.err.Error()
		}
		if result.result != nil {
			jsonResult["results"] = *result.result
			if c.taskOutput.includesJSON() {
				jsonResult["output"] = result.output
			}
			jsonResult["outputs"] = result.outputs
		}
		jsonResults[result.taskID] = jsonResult
	}
	return json.MarshalIndent(jsonResults, "", "  ")
}
7505
func (p *Parser) parse() (map[string]string, error) {
	p.scan() // init scannedItems

	labelsMap := map[string]string{}
	for {
		tok, lit := p.lookahead()
		switch tok {
		case IdentifierToken:
			key, value, err := p.parseLabel()
			if err != nil {
				return nil, fmt.Errorf("unable to parse requirement: %v", err)
			}
			labelsMap[key] = value
			t, l := p.consume()
			switch t {
			case EndOfStringToken:
				return labelsMap, nil
			case CommaToken:
				t2, l2 := p.lookahead()
				if t2 != IdentifierToken {
					return nil, fmt.Errorf("found '%s', expected: identifier after ','", l2)
				}
			default:
				return nil, fmt.Errorf("found '%s', expected: ',' or 'end of string'", l)
			}
		case EndOfStringToken:
			return labelsMap, nil
		default:
			return nil, fmt.Errorf("found '%s', expected: identifier or 'end of string'", lit)
		}
	}
}