// Functions for map layers with groupcache.
321265
func layerGetter(ctx groupcache.Context, key string, dest groupcache.Sink) error {
	m, err := fromKey(key)
	if err != nil {
		return err
	}

	land, err := m.nePolySVG(m.zoom, 0)
	if err != nil {
		return err
	}

	lakes, err := m.nePolySVG(m.zoom, 1)
	if err != nil {
		return err
	}

	l, err := m.labels()
	if err != nil {
		return err
	}

	var b bytes.Buffer

	b.WriteString(fmt.Sprintf("<path fill=\"wheat\" stroke-width=\"1\"  stroke-linejoin=\"round\" stroke=\"lightslategrey\" d=\"%s\"/>", land))
	b.WriteString(fmt.Sprintf("<path fill=\"azure\" stroke-width=\"1\"  stroke=\"lightslategrey\" d=\"%s\"/>", lakes))
	b.WriteString(labelsToSVG(l))

	return dest.SetString(b.String())
}
308686
func materializeTaskGroups(job *structs.Job) map[string]*structs.TaskGroup {
	out := make(map[string]*structs.TaskGroup)
	if job.Stopped() {
		return out
	}

	for _, tg := range job.TaskGroups {
		for i := 0; i < tg.Count; i++ {
			name := fmt.Sprintf("%s.%s[%d]", job.Name, tg.Name, i)
			out[name] = tg
		}
	}
	return out
}
687003
func AsMap(obj interface{}, includeGlobals bool) context.Map {
	return cm.AsMap(obj, includeGlobals)
}
562688
func groupBy(entries interface{}, key string) (map[string][]interface{}, error) {
	return generalizedGroupByKey("groupBy", entries, key, func(groups map[string][]interface{}, value interface{}, v interface{}) {
		groups[value.(string)] = append(groups[value.(string)], v)
	})
}
399570
func (m MultiRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (mapping *RESTMapping, err error) {
	for _, t := range m {
		mapping, err = t.RESTMapping(gk, versions...)
		if err == nil {
			return
		}
	}
	return
}
121159
func (g *Group) Go(fn func() error) {
	g.wg.Add(1)
	go func() {
		err := fn()
		if err != nil {
			g.mu.Lock()
			g.errs = append(g.errs, err)
			g.mu.Unlock()
		}
		g.wg.Done()
	}()
}
505289
func main() {
	args := map[string]string{}
	gp := geopattern.Generate(args)
	fmt.Println(gp)
}
581365
func (c *LayeredCache) Clear() {
	for _, bucket := range c.buckets {
		bucket.clear()
	}
	c.size = 0
	c.list = list.New()
}
819710
func (g *group) Go(f func()) {
	g.wg.Add(1)
	go func() {
		defer g.wg.Done()
		f()
	}()
}
50795
func (p *Partial) Function() (f Function, err error) {
	err = p.Unmarshal(&f)
	return
}
200138
func (e *edge) slowCacheFunc(dep *dep) ResultBasedCacheFunc {
	if e.cacheMap == nil {
		return nil
	}
	return e.cacheMap.Deps[int(dep.index)].ComputeDigestFunc
}
682693
func (a *Allocator) ForeachCache(cb RangeFunc) {
	a.mainCache.foreach(cb)

	a.remoteCachesMutex.RLock()
	for rc := range a.remoteCaches {
		rc.cache.foreach(cb)
	}
	a.remoteCachesMutex.RUnlock()
}
12325
func (gt *Getter) Get(ctx groupcache.Context, key string, dest groupcache.Sink) error {
	myctx, ok := ctx.(*Context)
	if !ok {
		return fmt.Errorf("invalid context type: %T", ctx)
	}
	if myctx == nil {
		return fmt.Errorf("context is nil")
	}
	if myctx.Params == nil {
		return fmt.Errorf("context has nil Params")
	}
	im, err := gt.Server.Get(myctx.Params)
	if err != nil {
		return err
	}
	data, err := im.MarshalBinary()
	if err != nil {
		return err
	}
	return dest.SetBytes(data)
}
292373
func Cache(src, cache FS) FS {
	return &cachedFS{
		src:   src,
		cache: cache,
	}
}
87097
func groupByKeys(entries interface{}, key string) ([]string, error) {
	keys, err := generalizedGroupByKey("groupByKeys", entries, key, func(groups map[string][]interface{}, value interface{}, v interface{}) {
		groups[value.(string)] = append(groups[value.(string)], v)
	})

	if err != nil {
		return nil, err
	}

	ret := []string{}
	for k := range keys {
		ret = append(ret, k)
	}
	return ret, nil
}
349476
func MergeFuncMap(funcs ...map[string]ZlispUserFunction) map[string]ZlispUserFunction {
	n := make(map[string]ZlispUserFunction)

	for _, f := range funcs {
		for k, v := range f {
			// disallow dups, avoiding possible security implications and confusion generally.
			if _, dup := n[k]; dup {
				panic(fmt.Sprintf(" duplicate function '%s' not allowed", k))
			}
			n[k] = v
		}
	}
	return n
}
1374422
func MapS(f func(string) string, sl []string) (result []string) {
	result = make([]string, len(sl))
	for i := range sl {
		result[i] = f(sl[i])
	}
	return result
}