//getValuesFromJSON returns query values from unmarshaled JSON column
519650
func (db *SQLDB) getValuesFromJSON(JSON string) ([]interface{}, error) {
	pointers := make([]interface{}, 0)
	bytes := []byte(JSON)
	err := json.Unmarshal(bytes, &pointers)
	return pointers, err
}
35008
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	vars := make(map[string]string)
	for _, key := range keys {
		// Check if we can find the single item
		m := make(map[string]*dynamodb.AttributeValue)
		m["key"] = &dynamodb.AttributeValue{S: aws.String(key)}
		g, err := c.client.GetItem(&dynamodb.GetItemInput{Key: m, TableName: &c.table})
		if err != nil {
			return vars, err
		}

		if g.Item != nil {
			if val, ok := g.Item["value"]; ok {
				if val.S != nil {
					vars[key] = *val.S
				} else {
					log.Warning("Skipping key '%s'. 'value' is not of type 'string'.", key)
				}
				continue
			}
		}

		// Check for nested keys
		q, err := c.client.Scan(
			&dynamodb.ScanInput{
				ScanFilter: map[string]*dynamodb.Condition{
					"key": &dynamodb.Condition{
						AttributeValueList: []*dynamodb.AttributeValue{
							&dynamodb.AttributeValue{S: aws.String(key)}},
						ComparisonOperator: aws.String("BEGINS_WITH")}},
				AttributesToGet: []*string{aws.String("key"), aws.String("value")},
				TableName:       aws.String(c.table),
				Select:          aws.String("SPECIFIC_ATTRIBUTES"),
			})

		if err != nil {
			return vars, err
		}

		for _, i := range q.Items {
			item := i
			if val, ok := item["value"]; ok {
				if val.S != nil {
					vars[*item["key"].S] = *val.S
				} else {
					log.Warning("Skipping key '%s'. 'value' is not of type 'string'.", *item["key"].S)
				}
				continue
			}
		}
	}
	return vars, nil
}
730370
func KeyValuesFromLines(content []byte) ([]Pair, error) {
	var kvs []Pair

	scanner := bufio.NewScanner(bytes.NewReader(content))
	currentLine := 0
	for scanner.Scan() {
		// Process the current line, retrieving a key/value pair if
		// possible.
		scannedBytes := scanner.Bytes()
		kv, err := KeyValuesFromLine(scannedBytes, currentLine)
		if err != nil {
			return nil, err
		}
		currentLine++

		if len(kv.Key) == 0 {
			// no key means line was empty or a comment
			continue
		}

		kvs = append(kvs, kv)
	}
	return kvs, nil
}
839367
func (c Client) GetProperties(name string) (bool, map[string]string, error) {
	nameExists, err := c.nameExists(name)
	if err != nil {
		return false, nil, err
	}

	if !nameExists {
		return false, nil, nil
	}

	properties := make(map[string]string)

	var continueToken string
	for {
		res, err := c.getHTTP("Names/"+name+"/$/GetProperties", withContinue(continueToken), withParam("IncludeValues", "true"))
		if err != nil {
			return false, nil, err
		}

		var propertiesListPage PropertiesListPage
		err = json.Unmarshal(res, &propertiesListPage)
		if err != nil {
			return false, nil, fmt.Errorf("could not deserialise JSON response: %+v", err)
		}

		for _, property := range propertiesListPage.Properties {
			if property.Value.Kind != "String" {
				continue
			}
			properties[property.Name] = property.Value.Data
		}

		continueToken = propertiesListPage.ContinuationToken
		if continueToken == "" {
			break
		}
	}

	return true, properties, nil
}
574063
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	// Ensure we have a connected redis client
	rClient, err := c.connectedClient()
	if err != nil && err != redis.ErrNil {
		return nil, err
	}

	vars := make(map[string]string)
	for _, key := range keys {
		key = strings.Replace(key, "/*", "", -1)

		k := c.transform(key)
		t, err := redis.String(rClient.Do("TYPE", k))

		if err == nil && err != redis.ErrNil {

			if t == "string" {
				value, err := redis.String(rClient.Do("GET", k))
				if err == nil {
					vars[key] = value
					continue
				}
				if err != redis.ErrNil {
					return vars, err
				}
			} else if t == "hash" {
				idx := 0
				for {
					values, err := redis.Values(rClient.Do("HSCAN", k, idx, "MATCH", "*", "COUNT", "1000"))
					if err != nil && err != redis.ErrNil {
						return vars, err
					}
					idx, _ = redis.Int(values[0], nil)
					items, _ := redis.Strings(values[1], nil)
					for i := 0; i < len(items); i+=2 {
						var newKey, value string
						if newKey, err = redis.String(items[i], nil); err != nil {
							return vars, err
						}
						if value, err = redis.String(items[i+1], nil); err != nil {
							return vars, err
						}
						vars[c.clean(k + "/" + newKey)] = value
					}
					if idx == 0 {
						break
					}
				}
			} else {
				if key == "/" {
					k = "*"
				} else {
					k = fmt.Sprintf(c.transform("%s/*"), k)
				}
		
				idx := 0
				for {
					values, err := redis.Values(rClient.Do("SCAN", idx, "MATCH", k, "COUNT", "1000"))
					if err != nil && err != redis.ErrNil {
						return vars, err
					}
					idx, _ = redis.Int(values[0], nil)
					items, _ := redis.Strings(values[1], nil)
					for _, item := range items {
						var newKey string
						if newKey, err = redis.String(item, nil); err != nil {
							return vars, err
						}
						if value, err := redis.String(rClient.Do("GET", newKey)); err == nil {
							vars[c.clean(newKey)] = value
						}
					}
					if idx == 0 {
						break
					}
				}
			}
		} else {
			return vars, err
		}
	}

	log.Debug(fmt.Sprintf("Key Map: %#v", vars))

	return vars, nil
}
1299150
func (ema *EMASeries) GetFirstValues() (x, y float64) {
	if ema.InnerSeries == nil {
		return
	}
	if len(ema.cache) == 0 {
		ema.ensureCachedValues()
	}
	x, _ = ema.InnerSeries.GetValues(0)
	y = ema.cache[0]
	return
}
132644
func (f *GoMultipartForm) GetValues() url.Values {
	return url.Values(f.Form.Value)
}
440168
func (mc MongoClient) getValueDescriptor(q bson.M) (models.ValueDescriptor, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	var m models.ValueDescriptor
	if err := s.DB(mc.database.Name).C(db.ValueDescriptorCollection).Find(q).One(&m); err != nil {
		return models.ValueDescriptor{}, errorMap(err)
	}
	return m, nil
}
776145
func GetValue(req *http.Request, key string) string {
	return GetAllValues(req)[key]
}
1255319
func GetJSONPathValue(obj interface{}, path string, allowMissingKeys bool) (interface{}, error) {
	j := jsonpath.New("GetJSONPathValue")
	// If the key is missing, return an empty string without errors
	j.AllowMissingKeys(allowMissingKeys)
	err := j.Parse(path)
	if err != nil {
		return "", errors.Wrapf(err, "JsonPath parse %s error", path)
	}
	values, err := j.FindResults(obj)
	if err != nil {
		return "", errors.Wrap(err, "JsonPath execute error")
	}
	if len(values) == 0 {
		return nil, nil
	}
	if len(values) > 1 {
		return nil, errors.Errorf("single result expected, got %d", len(values))
	}
	if values[0] == nil || len(values[0]) == 0 || values[0][0].IsNil() {
		return nil, nil
	}
	return values[0][0].Interface(), nil
}
1302573
func (c *Client) GetValues(keys []string) (map[string]string, error) {
	vars := make(map[string]string)
	var err error
	for _, key := range keys {
		log.Debug("Processing key=%s", key)
		var resp map[string]string
		resp, err = c.getParametersWithPrefix(key)
		if err != nil {
			return vars, err
		}
		if len(resp) == 0 {
			resp, err = c.getParameter(key)
			if err != nil && err.(awserr.Error).Code() != ssm.ErrCodeParameterNotFound {
				return vars, err
			}
		}
		for k, v := range resp {
			vars[k] = v
		}
	}
	return vars, nil
}
817425
func (pdb *BrokerCassa) GetValue(query sql.Expression, reqObj interface{}) (found bool, err error) {
	it := pdb.ListValues(query)
	stop := it.GetNext(reqObj)
	return !stop, it.Close()
}
300933
func ConvertToQueryValues(ifc interface{}) url.Values {
	values := url.Values{}
	SetQueryValues(ifc, &values)
	return values
}
31862
func ReadValues(data []byte) (vals Values, err error) {
	err = yaml.Unmarshal(data, &vals)
	if len(vals) == 0 {
		vals = Values{}
	}
	return
}
607234
func (ema *EMASeries) GetValues(index int) (x, y float64) {
	if ema.InnerSeries == nil {
		return
	}
	if len(ema.cache) == 0 {
		ema.ensureCachedValues()
	}
	vx, _ := ema.InnerSeries.GetValues(index)
	x = vx
	y = ema.cache[index]
	return
}
691677
func (prs *PolynomialRegressionSeries) GetValues(index int) (x, y float64) {
	if prs.InnerSeries == nil || prs.InnerSeries.Len() == 0 {
		return
	}

	if prs.coeffs == nil {
		coeffs, err := prs.computeCoefficients()
		if err != nil {
			panic(err)
		}
		prs.coeffs = coeffs
	}

	offset := prs.GetOffset()
	effectiveIndex := util.Math.MinInt(index+offset, prs.InnerSeries.Len())
	x, y = prs.InnerSeries.GetValues(effectiveIndex)
	y = prs.apply(x)
	return
}
49769
func (ts TimeSeries) GetValues(index int) (x, y float64) {
	x = util.Time.ToFloat64(ts.XValues[index])
	y = ts.YValues[index]
	return
}