// FromString reads an ID from its string representation
194986
func FromString(id string) (ID, error) {
	i := &ID{}
	err := i.UnmarshalText([]byte(id))
	return *i, err
}
845694
func FromString(s string) *Graph {
	p := NewParser(bytes.NewBuffer([]byte(s)))
	p.Ogdl()
	return p.Graph()
}
281986
func FromInt(val int) IntOrString {
	if val > math.MaxInt32 || val < math.MinInt32 {
		klog.Errorf("value: %d overflows int32\n%s\n", val, debug.Stack())
	}
	return IntOrString{Type: Int, IntVal: int32(val)}
}
561881
func (addr Addr) ToString() string {
	return fmt.Sprintf("%s:%d", addr.Host, addr.Port)
}
770049
func FromString(input string) (UUID, error) {
	u, err := uuid.FromString(input)
	return UUID(u), err
}
732473
func fromString(att *design.AttributeDefinition, varName string) string {
	switch att.Type.Kind() {
	case design.BooleanKind:
		return "strconv.ParseBool(" + varName + ")"
	case design.IntegerKind:
		return "strconv.Atoi(" + varName + ")"
	case design.NumberKind:
		return "strconv.ParseFloat(" + varName + ")"
	case design.StringKind:
		return varName + ", (error)(nil)"
	case design.ArrayKind:
	case design.HashKind:
		return valueTypeOf("", att) + "{}, (error)(nil)"
	}
	return "(" + valueTypeOf("", att) + ")(nil), (error)(nil)"
}
1020395
func ToString(i interface{}) string {
	switch t := i.(type) {
	case nil:
		return ""
	case []byte:
		return string(t)
	case string:
		return t
	case *string:
		return *t
	case bool:
		return strconv.FormatBool(t)
	case float32:
		return strconv.FormatFloat(float64(t), 'f', -1, 32)
	case float64:
		return strconv.FormatFloat(t, 'f', -1, 64)
	case int:
		return strconv.Itoa(t)
	case int32:
		return strconv.FormatInt(int64(t), 10)
	case int64:
		return strconv.FormatInt(t, 10)
	case template.HTML:
		return string(t)
	case template.URL:
		return string(t)
	case fmt.Stringer:
		return t.String()
	case error:
		return t.Error()
	default:
		return fmt.Sprint(i)
	}
}
521931
func FromInt(val int) IntOrString {
	return IntOrString{Type: Int, IntVal: int32(val)}
}
974748
func (si *SI) ToString() string {
	defer si.mu.Unlock()
	si.mu.Lock()
	return si.String()
}
445258
func (s *DeleteByQueryService) From(from int) *DeleteByQueryService {
	s.from = &from
	return s
}
985664
func FromJSON(data *[]byte, current string, namespace *[]string) error {

	var m map[string]interface{}
	err := json.Unmarshal(*data, &m)

	if err != nil {
		return err
	}

	return FromMap(m, current, namespace)
}
1301996
func FromString(s string) (*GUID, error) {
	if len(s) != 36 {
		return nil, errors.New("invalid GUID format (length)")
	}
	if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
		return nil, errors.New("invalid GUID format (dashes)")
	}

	var g GUID

	data1, err := strconv.ParseUint(s[0:8], 16, 32)
	if err != nil {
		return nil, errors.Wrap(err, "invalid GUID format (Data1)")
	}
	g.Data1 = uint32(data1)

	data2, err := strconv.ParseUint(s[9:13], 16, 16)
	if err != nil {
		return nil, errors.Wrap(err, "invalid GUID format (Data2)")
	}
	g.Data2 = uint16(data2)

	data3, err := strconv.ParseUint(s[14:18], 16, 16)
	if err != nil {
		return nil, errors.Wrap(err, "invalid GUID format (Data3)")
	}
	g.Data3 = uint16(data3)

	for i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} {
		v, err := strconv.ParseUint(s[x:x+2], 16, 8)
		if err != nil {
			return nil, errors.Wrap(err, "invalid GUID format (Data4)")
		}
		g.Data4[i] = uint8(v)
	}

	return &g, nil
}
1252937
func (t *Taint) ToString() string {
	if len(t.Value) == 0 {
		return fmt.Sprintf("%v:%v", t.Key, t.Effect)
	}
	return fmt.Sprintf("%v=%v:%v", t.Key, t.Value, t.Effect)
}
394859
func (formatter *Formatter) ToString(data interface{}) string {
	if str, ok := data.(string); ok {
		return str
	}

	if byteSlice, ok := data.([]byte); ok {
		return string(byteSlice)
	}

	return fmt.Sprintf("%v", data)
}
235545
func (ns *Namespace) FromString(targetPathIn, contentIn interface{}) (resource.Resource, error) {
	targetPath, err := cast.ToStringE(targetPathIn)
	if err != nil {
		return nil, err
	}
	content, err := cast.ToStringE(contentIn)
	if err != nil {
		return nil, err
	}

	return ns.createClient.FromString(targetPath, content)
}
1359636
func (c *Cache) ToString() string {
	c.Lock()
	defer c.Unlock()

	return fmt.Sprintf("%d/%d", c.max, len(c.data))
}
586342
func (t *FromNode) String() string {
	keys := make([]string, len(t.Imports))
	i := 0
	for orig := range t.Imports {
		keys[i] = orig
		i++
	}
	sort.Strings(keys)
	res := make([]string, len(t.Imports))
	for i, orig := range keys {
		if orig == t.Imports[orig] {
			res[i] = orig
		} else {
			res[i] = orig + " as " + t.Imports[orig]
		}
	}
	return fmt.Sprintf("From %s import %s", t.Tpl, strings.Join(res, ", "))
}