// AsNamedArgsWithTypes builds a string that represents parameters as named
// arugments to a function, with associated types.
515487
func (p Params) AsNamedArgsWithTypes() string {
	if len(p) == 0 {
		return ""
	}

	params := []string{}
	for i := range p {
		params = append(params, unexport(p[i].Name)+" "+p[i].Type)
	}
	return strings.Join(params, ", ")
}
1211626
func ProviderTypeToString(id ProviderType) string {
	if res, found := mspTypeStrings[id]; found {
		return res
	}

	return ""
}
859469
func Types() []string {
	typesMu.RLock()
	defer typesMu.RUnlock()
	var list []string
	for name := range types {
		list = append(list, name)
	}
	sort.Strings(list)
	return list
}
706057
func InstanceTypes(cons instanceTypeConstraints) (params.InstanceTypesResult, error) {
	instanceTypes, err := cons.environ.InstanceTypes(cons.context, cons.constraints)
	if err != nil {
		return params.InstanceTypesResult{}, errors.Trace(err)
	}

	return params.InstanceTypesResult{
		InstanceTypes: toParamsInstanceTypeResult(instanceTypes.InstanceTypes),
		CostUnit:      instanceTypes.CostUnit,
		CostCurrency:  instanceTypes.CostCurrency,
		CostDivisor:   instanceTypes.CostDivisor,
	}, nil
}
1198047
func (p *MetaProject) GetIssueTypeWithName(name string) *MetaIssueType {
	for _, m := range p.IssueTypes {
		if strings.ToLower(m.Name) == strings.ToLower(name) {
			return m
		}
	}
	return nil
}
1115546
func AllTypes(apiDef *raml.APIDefinition, pkgName string) map[string]TypeTask {
	mtt := map[string]TypeTask{}

	// from types
	for name, tip := range apiDef.Types {
		mtt[name] = TypeTask{
			Type: tip,
			Pkg:  pkgName,
			Name: name,
		}
	}

	for _, endpoints := range getAllEndpoints(apiDef) {
		for _, ep := range endpoints {
			tts := getTypesOfEndpoint(ep, pkgName)
			for _, tt := range tts {
				mtt[tt.Name] = tt
			}
		}
	}
	return mtt
}
1241189
func (t *Template) GetAWSSSMParameterWithName(name string) (*resources.AWSSSMParameter, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSSSMParameter:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSSSMParameter not found", name)
}
792182
func RelationsOfTypes(rels []Relation, relTypes ...string) []Relation {

	var out []Relation

	for _, rel := range rels {
		for _, relType := range relTypes {
			if rel.TypeOf() == relType {
				out = append(out, rel)
			}
		}
	}

	return out
}
1347575
func encodeSmethodArgs(args Args) string {
	if args == nil {
		return ""
	}

	keys := make([]string, 0, len(args))
	for key := range args {
		keys = append(keys, key)
	}
	sort.Strings(keys)

	escape := func(s string) string {
		return backslashEscape(s, []byte{'=', ','})
	}

	var pairs []string
	for _, key := range keys {
		for _, value := range args[key] {
			pairs = append(pairs, escape(key)+"="+escape(value))
		}
	}

	return strings.Join(pairs, ",")
}
297566
func ReturnTypes(t interface{}) []string {
	if reflect.TypeOf(t).Kind() != reflect.Func {
		// Invalid provide, will be logged as an error.
		return []string{}
	}

	rtypes := []string{}
	ft := reflect.ValueOf(t).Type()

	for i := 0; i < ft.NumOut(); i++ {
		t := ft.Out(i)

		traverseOuts(key{t: t}, func(s string) {
			rtypes = append(rtypes, s)
		})
	}

	return rtypes
}
1026590
func (ctx *Context) ParamStrings(key string, defaults ...[]string) []string {
	return ctx.Params().MustStrings(key, defaults...)
}
211140
func (g *Generator) TypeNameWithPackage(obj Object) string {
	return obj.PackageName() + CamelCaseSlice(obj.TypeName())
}
1287628
func (c *Cmd) WithArgs(args ...CmdArg) *Cmd {
	c.args = args
	return c
}
718779
func TypeFromString(str string) Type {
	for t, d := range definitions {
		if d.name == str {
			return t
		}
	}

	panic("Type not registered")
}
970806
func (domain *Domain) TypeNameForStub(stub string) string {


	return domain.Prefix + strings.ToUpper(stub[0:1]) + stub[1:len(stub)]
}
1242560
func NewTypePropertyWithNameTypeAndPattern(name string, typeName string, pattern string) *TypeProperty {
	return &TypeProperty{Name: name, Type: typeName, Pattern: pattern}
}
1172106
func (g *Generator) BuildTypeNameMap() {
	g.typeNameToObject = make(map[string]Object)
	for _, f := range g.allFiles {
		// The names in this loop are defined by the proto world, not us, so the
		// package name may be empty.  If so, the dotted package name of X will
		// be ".X"; otherwise it will be ".pkg.X".
		dottedPkg := "." + f.GetPackage()
		if dottedPkg != "." {
			dottedPkg += "."
		}
		for _, enum := range f.enum {
			name := dottedPkg + dottedSlice(enum.TypeName())
			g.typeNameToObject[name] = enum
		}
		for _, desc := range f.desc {
			name := dottedPkg + dottedSlice(desc.TypeName())
			g.typeNameToObject[name] = desc
		}
	}
}