// NewSet creates a new set, dirs is a list of directories to be searched for templates
334371
func NewSet(escapee SafeWriter, dirs ...string) *Set {
	return NewSetLoader(escapee, &OSFileSystemLoader{dirs: dirs})
}
584269
func (d Dir) SearchPaths() []string {
	if d.env == "" {
		panic("xdgdir.Dir.SearchPaths() on zero Dir")
	}
	var paths []string
	if p := d.Path(); p != "" {
		paths = append(paths, p)
	}
	if d.dirsEnv == "" {
		return paths
	}
	e := getenv(d.dirsEnv)
	if e == "" {
		paths = append(paths, d.dirsFallback...)
		return paths
	}
	epaths := filepath.SplitList(e)
	n := 0
	for _, p := range epaths {
		if isValidPath(p) {
			epaths[n] = p
			n++
		}
	}
	paths = append(paths, epaths[:n]...)
	return paths
}
117718
func NewStorage(dir string, services *disco.Disco) *Storage {
	regClient := registry.NewClient(services, nil)

	return &Storage{
		StorageDir: dir,
		registry:   regClient,
	}
}
889761
func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets {
	return &statefulSets{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
1291376
func (db *RedisDB) stringSet(k, v string) {
	db.del(k, false)
	db.keys[k] = "string"
	db.stringKeys[k] = v
	db.keyVersion[k]++
}
830503
func (db *RedisDB) setSet(k string, set setKey) {
	db.keys[k] = "set"
	db.setKeys[k] = set
	db.keyVersion[k]++
}
931375
func NewSet(t ...*Term) Set {
	s := newset(len(t))
	for i := range t {
		s.Add(t[i])
	}
	return s
}
332543
func NewSetDiscoverTargetsArgs(discover bool) *SetDiscoverTargetsArgs {
	args := new(SetDiscoverTargetsArgs)
	args.Discover = discover
	return args
}
1138590
func (d *SourceFilesystem) RealDirs(from string) []string {
	var dirnames []string
	for _, dir := range d.Dirnames {
		dirname := filepath.Join(dir, from)
		if _, err := d.SourceFs.Stat(dirname); err == nil {
			dirnames = append(dirnames, dirname)
		}
	}
	return dirnames
}
12730
func NewSetFontSizesArgs(fontSizes FontSizes) *SetFontSizesArgs {
	args := new(SetFontSizesArgs)
	args.FontSizes = fontSizes
	return args
}
94777
func NewStringSet(ss []string) StringSet {
	res := StringSet{}
	for _, s := range ss {
		res[s] = struct{}{}
	}
	return res
}
154721
func (s *ListDirectoriesOutput) SetDirectories(v []*Directory) *ListDirectoriesOutput {
	s.Directories = v
	return s
}
214108
func NewSet(vs ...interface{}) Set {
	s := &set{make(map[interface{}]struct{})}
	s.Add(vs...)
	return s
}
1152059
func NewSetNode(varName string, expr Expr, pos Pos) *SetNode {
	return &SetNode{pos, TrimmableNode{}, varName, expr}
}
101629
func expandDirectories(dirs []string) ([]string, error) {
	const recursiveMarker = "/..."
	resultSet := make([]string, 0)
	for _, dir := range dirs {
		if strings.HasSuffix(dir, recursiveMarker) {
			err := filepath.Walk(strings.TrimSuffix(dir, recursiveMarker), func(path string, info os.FileInfo, err error) error {
				if info.IsDir() {
					resultSet = append(resultSet, path)
				}
				return nil
			})
			if err != nil {
				return nil, err
			}
		} else {
			info, err := os.Stat(dir)
			if err != nil {
				return nil, err
			}
			if !info.IsDir() {
				return nil, fmt.Errorf("%q is not a directory", dir)
			}
			resultSet = append(resultSet, dir)
		}
	}
	if len(resultSet) == 0 {
		// treat an empty list as a search in the current directory (think "ls")
		return []string{"."}, nil
	}

	return resultSet, nil
}
761910
func DirExists(dir string) bool {
	fi, err := os.Stat(dir)
	return err == nil && fi.IsDir()
}
1142338
func powerSet(set *Set) *Set {
	// Create the output set
	pSet := New()

	// If set is empty, return the nil set
	if set.Size() == 0 {
		pSet.Add(New())
		return pSet
	}

	// Get the head element of the set, and remove it
	head := set.Enumerate()[0]
	set.Remove(head)

	// Get the "tail" power set, and add it to the set
	tpSet := powerSet(set)
	for _, tp := range tpSet.Enumerate() {
		pSet.Add(tp)
	}

	// Iterate the "tail" power set and get the "head" power set,
	// and add it to the set
	for _, tp := range tpSet.Enumerate() {
		hSet := tp.(*Set).Clone()
		hSet.Add(head)
		pSet.Add(hSet)
	}

	return pSet
}