// Expand utilizes the sawyer expand method to convert a URI template into a full
// URL
351604
func (l Hyperlink) Expand(m M) (u *url.URL, err error) {
	sawyerHyperlink := hypermedia.Hyperlink(string(l))
	u, err = sawyerHyperlink.Expand(hypermedia.M(m))
	return
}
387320
func (c *CopyCommand) Expand(expander SingleWordExpander) error {
	expandedChown, err := expander(c.Chown)
	if err != nil {
		return err
	}
	c.Chown = expandedChown
	return expandSliceInPlace(c.SourcesAndDest, expander)
}
1299763
func (s *GetMappingService) ExpandWildcards(expandWildcards string) *GetMappingService {
	s.expandWildcards = expandWildcards
	return s
}
121190
func Expand(path string) (string, error) {
	if len(path) == 0 {
		return path, nil
	}

	if path[0] != '~' {
		return path, nil
	}

	if len(path) > 1 && path[1] != '/' && path[1] != '\\' {
		return "", errors.New("cannot expand user-specific home dir")
	}

	dir, err := Dir()
	if err != nil {
		return "", err
	}

	return filepath.Join(dir, path[1:]), nil
}
282381
func (ns Seq) Expand() []byte {
	s := make([]byte, ns.Length)
	for i := range s {
		if i&1 == 0 {
			s[i] = n16TableRev[ns.Seq[i>>1]>>4]
		} else {
			s[i] = n16TableRev[ns.Seq[i>>1]&0xf]
		}
	}

	return s
}
1267180
func (f *ComponentFlag) Expand(value string) sets.String {
	if len(value) == 0 {
		return sets.NewString()
	}
	items := strings.Split(value, ",")
	set := sets.NewString()
	for _, s := range items {
		if mapped, ok := f.mappings[s]; ok {
			set.Insert(mapped...)
		} else {
			set.Insert(s)
		}
	}
	return set
}
190834
func Expand(s string, fns ...KeyFunc) string {
	val, _ := ExpandStrict(s, append(fns, Empty)...)
	return val
}
943831
func (s *DeleteByQueryService) ExpandWildcards(expand string) *DeleteByQueryService {
	s.expandWildcards = expand
	return s
}
930437
func expandResourceShortcut(resource string) string {
	shortForms := map[string]string{
		// Please keep this alphabetized
		"cs":     "componentstatuses",
		"ev":     "events",
		"ep":     "endpoints",
		"hpa":    "horizontalpodautoscalers",
		"limits": "limitranges",
		"no":     "nodes",
		"ns":     "namespaces",
		"po":     "pods",
		"pv":     "persistentvolumes",
		"pvc":    "persistentvolumeclaims",
		"quota":  "resourcequotas",
		"rc":     "replicationcontrollers",
		"ds":     "daemonsets",
		"svc":    "services",
		"ing":    "ingresses",
	}
	if expanded, ok := shortForms[resource]; ok {
		return expanded
	}
	return resource
}
921282
func (c *EnvCommand) Expand(expander SingleWordExpander) error {
	return expandKvpsInPlace(c.Env, expander)
}
926286
func (s *IndicesFreezeService) ExpandWildcards(expandWildcards string) *IndicesFreezeService {
	s.expandWildcards = expandWildcards
	return s
}
225736
func (l Hyperlink) Expand(m M) (*url.URL, error) {
	template, err := uritemplates.Parse(string(l))
	if err != nil {
		return nil, err
	}

	// clone M to map[string]interface{}
	// if we don't do this type assertion will
	// fail on jtacoma/uritemplates
	// see https://github.com/jtacoma/uritemplates/blob/master/uritemplates.go#L189
	mm := make(map[string]interface{}, len(m))
	for k, v := range m {
		mm[k] = v
	}

	expanded, err := template.Expand(mm)
	if err != nil {
		return nil, err
	}

	return url.Parse(expanded)
}
1335226
func (s *IndicesExistsTypeService) ExpandWildcards(expandWildcards string) *IndicesExistsTypeService {
	s.expandWildcards = expandWildcards
	return s
}
1271878
func expandFiles(path string) ([]string, error) {
	// @check if the path is a directory, if not we can return straight away
	stat, err := os.Stat(path)
	if err != nil {
		return nil, err
	}
	// @check if not a directory and return as is
	if !stat.IsDir() {
		return []string{path}, nil
	}
	// @step: iterate the directory and get all the files
	var list []string
	if err := filepath.Walk(path, func(path string, f os.FileInfo, err error) error {
		if f.IsDir() {
			return nil
		}
		list = append(list, path)

		return nil
	}); err != nil {
		return nil, err
	}

	return list, nil
}
1004248
func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) {
	ret := []schema.GroupResource{}
	ok := false

	// Expand the category for each CategoryExpander in the list and merge/combine the results.
	for _, expansion := range u {
		curr, currOk := expansion.Expand(category)

		for _, currGR := range curr {
			found := false
			for _, existing := range ret {
				if existing == currGR {
					found = true
					break
				}
			}
			if !found {
				ret = append(ret, currGR)
			}
		}
		ok = ok || currOk
	}

	return ret, ok
}
1321459
func (s *PutMappingService) ExpandWildcards(expandWildcards string) *PutMappingService {
	s.expandWildcards = expandWildcards
	return s
}
474934
func (s *IndicesExistsService) ExpandWildcards(expandWildcards string) *IndicesExistsService {
	s.expandWildcards = expandWildcards
	return s
}