// AsArray returns an array of path keys.
338118
func (p *ResponsePath) AsArray() []interface{} {
	if p == nil {
		return nil
	}
	return append(p.Prev.AsArray(), p.Key)
}
388183
func asByteArray(blob []byte) string {
	out := &bytes.Buffer{}
	fmt.Fprintf(out, "[]byte{")
	for i := 0; i < len(blob); i++ {
		fmt.Fprintf(out, "%d, ", blob[i])
		if i%14 == 1 {
			fmt.Fprintln(out)
		}
	}
	fmt.Fprintf(out, "}")
	return out.String()
}
1063505
func (c *ARC) Keys() []interface{} {
	keys := []interface{}{}
	for _, k := range c.keys() {
		_, err := c.GetIFPresent(k)
		if err == nil {
			keys = append(keys, k)
		}
	}
	return keys
}
485075
func encodeArray(buf *bytes.Buffer, path, name string, val Array) error {
	// Array is encoded as a document with incrementing numeric keys.
	if len(val) == 0 {
		return nil
	}

	// type
	if err := buf.WriteByte(_ARRAY); err != nil {
		return err
	}

	// name
	if err := writeCstring(buf, name); err != nil {
		return err
	}

	// Create array doc.
	tmp := bytes.NewBuffer(make([]byte, 0))

	// This will be replaced by the size of the doc later.
	if err := binary.Write(tmp, binary.LittleEndian, uint32(0)); err != nil {
		return err
	}
	for i := 0; i < len(val); i++ {
		name := strconv.Itoa(i)
		var newpath string
		if path == "" {
			newpath = name
		} else {
			newpath = strings.Join([]string{path, name}, ".")
		}
		if err := encodeVal(tmp, newpath, name, val[i]); err != nil {
			return err
		}
	}

	// End of BSON null byte.
	if err := tmp.WriteByte(0x00); err != nil {
		return err
	}

	// Write size of document at start of BSON.
	binary.LittleEndian.PutUint32(tmp.Bytes(), uint32(tmp.Len()))
	buf.Write(tmp.Bytes())

	return nil
}
927074
func inArray(s byte, list []byte) bool {
	for _, el := range list {
		if el == s {
			return true
		}
	}
	return false
}
1039311
func (reader *PluginConfigReader) GetPluginArray(key string, defaultValue []Plugin) []Plugin {
	value, err := reader.WithError.GetPluginArray(key, defaultValue)
	reader.Errors.Push(err)
	return value
}
1016070
func GetMany(json string, path ...string) []Result {
	res := make([]Result, len(path))
	for i, path := range path {
		res[i] = Get(json, path)
	}
	return res
}
108517
func (p Params) AsArgs() string {
	if len(p) == 0 {
		return ""
	}

	params := []string{}
	for i := range p {
		params = append(params, p[i].Type)
	}
	return strings.Join(params, ", ")
}
960695
func (p Property) IsArray() bool {
	return p.Type == arrayType || strings.HasSuffix(p.TypeString(), "[]")
}
1156405
func (s *Sensu) doJSONArray(body []byte) ([]interface{}, error) {
	var results []interface{}
	if err := json.Unmarshal(body, &results); err != nil {
		return nil, fmt.Errorf("Parsing JSON-encoded response body: %v", err)
	}
	return results, nil
}
1091735
func (db *RedisDB) allKeys() []string {
	res := make([]string, 0, len(db.keys))
	for k := range db.keys {
		res = append(res, k)
	}
	sort.Strings(res) // To make things deterministic.
	return res
}
98808
func typeIsSliceOrArray(typ reflect.Type) bool {
	k := typ.Kind()
	return (k == reflect.Slice || k == reflect.Array) && typ.Elem().Kind() != reflect.Uint8
}
1167097
func (t Result) IsArray() bool {
	return t.Type == JSON && len(t.Raw) > 0 && t.Raw[0] == '['
}
263531
func AppPath(root string, appName types.ACName) string {
	return filepath.Join(AppsPath(root), appName.String())
}
557616
func parseArray(array string) []string {
	results := []string{}
	matches := arrayExp.FindAllStringSubmatch(array, -1)
	for _, match := range matches {
		s := match[valueIndex]
		// the string _might_ be wrapped in quotes, so trim them:
		s = strings.Trim(s, "\"")
		results = append(results, s)
	}
	return results
}
577503
func (self *Commands) IsArray(value interface{}) error {
	if typeutil.IsArray(value) {
		return nil
	} else {
		return fmt.Errorf("Expected array value")
	}
}
1240803
func (v *arraySchemaVisitor) VisitArray(result *proto.Array) {
	v.Result = result
	v.Kind = "array"
	v.Err = copySubElementPatchStrategy(result.Path.String(), result.GetExtensions(), result.SubType.GetExtensions())
}