// We have some different numeric and string types that we try to behave like
// they were the same.
967483
func convertValue(v reflect.Value, to reflect.Type) (reflect.Value, error) {
	if v.Type().AssignableTo(to) {
		return v, nil
	}
	switch kind := to.Kind(); {
	case kind == reflect.String:
		s, err := toString(v)
		return reflect.ValueOf(s), err
	case isNumber(kind):
		return convertNumber(v, kind)
	default:
		return reflect.Value{}, errors.Errorf("%s is not assignable to %s", v.Type(), to)
	}
}
807498
func (t Type) String() string {
	s := ""
	if 0 <= t && t < Type(len(tokens)) {
		s = tokens[t]
	}
	if s == "" {
		s = "token(" + strconv.Itoa(int(t)) + ")"
	}
	return s
}
184030
func (t itemType) String() string {
	for k, v := range builtinIdents {
		if v == t {
			return k
		}
	}
	for k, v := range arithmeticItemsBySymbol {
		if v == t {
			return k
		}
	}
	var r, ok = map[itemType]string{
		itemEOF:              "<eof>",
		itemEquals:           "=",
		itemError:            "<error>",
		itemText:             "<text>",
		itemLeftDelim:        "{",
		itemRightDelim:       "}",
		itemRightDelimEnd:    "/}",
		itemIdent:            "<ident>",
		itemDollarIdent:      "<$ident>",
		itemDotIdent:         "<.ident>",
		itemQuestionDotIdent: "<?.ident>",
		itemDotIndex:         "<.N>",
		itemQuestionDotIndex: "<?.N>",
		itemLeftBracket:      "[",
		itemRightBracket:     "]",
		itemQuestionKey:      "?[",
	}[t]
	if ok {
		return r
	}
	return fmt.Sprintf("item(%d)", t)
}
1347532
func Strings(input []string) []StringPop {
	commonalities := make(map[string]int)
	for _, line := range input {
		commonalities[line] += 1
	}

	lineCounts := []StringPop{}
	for line, count := range commonalities {
		lineCounts = append(lineCounts, StringPop{line, count})
	}

	sort.Sort(sort.Reverse(StringPops(lineCounts)))
	return lineCounts
}
786726
func parseType(def string) typeParserResult {
	parser := &typeParser{input: def}
	return parser.parse()
}
1265889
func DataTypeFromString(s string) DataType {
	switch s {
	case "float":
		return Float
	case "integer":
		return Integer
	case "unsigned":
		return Unsigned
	case "string":
		return String
	case "boolean":
		return Boolean
	case "time":
		return Time
	case "duration":
		return Duration
	case "tag":
		return Tag
	case "field":
		return AnyField
	default:
		return Unknown
	}
}
72528
func (r *queryTable) Strings(j int) *array.Binary {
	return r.cols[j].(*array.Binary)
}
1173655
func IsComparableNumeric(v interface{}) bool {

	switch v.(type) {
	case bool, int, int8, int32, int64,
		uint, uint8, uint32, uint64,
		float32, float64:

		return true
	}
	return false
}
752344
func (t PrimitiveType) String() string {
	var v string
	switch t {
	case NullType:
		v = "null"
	case IntegerType:
		v = "integer"
	case StringType:
		v = "string"
	case ObjectType:
		v = "object"
	case ArrayType:
		v = "array"
	case BooleanType:
		v = "boolean"
	case NumberType:
		v = "number"
	default:
		v = "<invalid>"
	}
	return v
}
869597
func (s *Script) Type(typ string) *Script {
	s.typ = typ
	return s
}
40862
func Strings(data []string) []string {
	sort.Strings(data)
	n := Uniq(sort.StringSlice(data))
	return data[:n]
}
629149
func (s *CountService) Types(types ...string) *CountService {
	if s.typ == nil {
		s.typ = make([]string, 0)
	}
	s.typ = append(s.typ, types...)
	return s
}
1300951
func Strings(strings []string) string {
	var buf bytes.Buffer

	for _, s := range strings {
		buf.WriteString(fmt.Sprintf("%s-", s))
	}

	return fmt.Sprintf("%d", String(buf.String()))
}
487768
func (p *Parameter) DataType(typeName string) *Parameter {
	p.data.DataType = typeName
	return p
}
859469
func Types() []string {
	typesMu.RLock()
	defer typesMu.RUnlock()
	var list []string
	for name := range types {
		list = append(list, name)
	}
	sort.Strings(list)
	return list
}
1109388
func (t Type) String() string {
	if int(t) < len(eventTypeStrings) {
		return eventTypeStrings[t]
	}
	return "custom"
}
649520
func jsonType(v interface{}) string {
	switch v.(type) {
	case nil:
		return "null"
	case bool:
		return "boolean"
	case json.Number, float64, int, int32, int64:
		return "number"
	case string:
		return "string"
	case []interface{}:
		return "array"
	case map[string]interface{}:
		return "object"
	}
	panic(InvalidJSONTypeError(fmt.Sprintf("%T", v)))
}