//Camelize "dino_party" -> "DinoParty"
439261
func (rs *Ruleset) Camelize(word string) string {
	if rs.isAcronym(word) {
		return strings.ToUpper(word)
	}
	words := splitAtCaseChangeWithTitlecase(word)
	return strings.Join(words, "")
}
1224402
func (rs *Ruleset) Tableize(word string) string {
	return rs.Pluralize(rs.Underscore(rs.Typeify(word)))
}
293036
func CamelToSnake(s string) string {
	var result string
	var words []string
	var lastPos int
	rs := []rune(s)

	for i := 0; i < len(rs); i++ {
		if i > 0 && unicode.IsUpper(rs[i]) {
			if initialism := startsWithInitialism(s[lastPos:]); initialism != "" {
				words = append(words, initialism)

				i += len(initialism) - 1
				lastPos = i
				continue
			}

			words = append(words, s[lastPos:i])
			lastPos = i
		}
	}

	// append the last word
	if s[lastPos:] != "" {
		words = append(words, s[lastPos:])
	}

	for k, word := range words {
		if k > 0 {
			result += "_"
		}

		result += strings.ToLower(word)
	}

	return result
}
1116233
func (a ArgPattern) Expand() [][]string {
	labels := make([][]string, len(a))
	for i := range labels {
		labels[i] = a[i].Expand()
	}
	return argExpander(labels)
}
734201
func (c *LRU) Resize(n int) {
	c.mu.Lock()
	if n < len(c.table) {
		c.drop(len(c.table) - n)
	}
	c.cap = n
	c.mu.Unlock()
}
750938
func (m *MockVolumeDriver) UsedSize(arg0 string) (uint64, error) {
	ret := m.ctrl.Call(m, "UsedSize", arg0)
	ret0, _ := ret[0].(uint64)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
569984
func Camel(s string) string {
	first := ' '
	for _, c := range s {
		if unicode.IsLetter(c) || unicode.IsNumber(c) {
			first = c
			break
		}
	}
	return strings.TrimSpace(string(unicode.ToLower(first)) + Pascal(s)[1:])
}
784918
func goNormalize(s string) string {
	fmtd := xstrings.ToCamelCase(s)
	return formatID(s, fmtd)
}
1225876
func (env *EnvironmentItemModel) Normalize() error {
	opts, err := env.GetOptions()
	if err != nil {
		return err
	}
	(*env)[OptionsKey] = opts
	return nil
}
1161646
func (f *File) Normalize() error {
	me := errors.MultiError(nil)
	for tname, t := range f.Template {
		if err := t.Normalize(); err != nil {
			me = append(me, fmt.Errorf("for template %q: %s", tname, err))
		}
	}
	if len(me) > 0 {
		return me
	}
	return nil
}
375061
func (r *Resources) Canonicalize() {
	defaultResources := DefaultResources()
	if r.CPU == nil {
		r.CPU = defaultResources.CPU
	}
	if r.MemoryMB == nil {
		r.MemoryMB = defaultResources.MemoryMB
	}
	for _, n := range r.Networks {
		n.Canonicalize()
	}
	for _, d := range r.Devices {
		d.Canonicalize()
	}
}
47931
func (rs *Ruleset) Typeify(word string) string {
	word = tablePrefix.ReplaceAllString(word, "")
	return rs.Camelize(rs.Singularize(word))
}
306007
func (d *DepsStage) Normalize() error {
	for _, d := range d.Deps {
		if err := d.Normalize(); err != nil {
			return err
		}
	}
	return nil
}
534413
func resize(bs []byte, size int) []byte {
	if cap(bs) < size {
		return make([]byte, size)
	}
	return bs[:size]
}
1092752
func Emojitize(emojis string) string {
	return reg.ReplaceAllStringFunc(emojis, func(str string) string {
		return Emoji(str) + " "
	})
}
1341952
func Flatten(resources []mesos.Resource, opts ...FlattenOpt) []mesos.Resource {
	var flattened mesos.Resources
	fc := &flattenConfig{}
	for _, f := range opts {
		f(fc)
	}
	if fc.role == "" {
		fc.role = mesos.DefaultRole
	}
	// we intentionally manipulate a copy 'r' of the item in resources
	for _, r := range resources {
		r.Role = &fc.role
		r.Reservation = fc.reservation
		flattened.Add1(r)
	}
	return flattened
}
455121
func (gdw *NaiveDiffDriver) DiffSize(id, parent string) (size int64, err error) {
	driver := gdw.ProtoDriver

	changes, err := gdw.Changes(id, parent)
	if err != nil {
		return
	}

	layerFs, err := driver.Get(id, "")
	if err != nil {
		return
	}
	defer driver.Put(id)

	return archive.ChangesSize(layerFs.Path(), changes), nil
}