// Defs renders a statement list enclosed in parenthesis. Use for definition lists.
18359
func (s *Statement) Defs(definitions ...Code) *Statement {
	g := &Group{
		close:     ")",
		items:     definitions,
		multi:     true,
		name:      "defs",
		open:      "(",
		separator: "",
	}
	*s = append(*s, g)
	return s
}
475861
func DirExists(fs Fs, path string) (bool, error) {
	fi, err := fs.Stat(path)
	if err == nil && fi.IsDir() {
		return true, nil
	}
	if os.IsNotExist(err) {
		return false, nil
	}
	return false, err
}
524583
func (g *Group) Do(f func(*Statement)) *Statement {
	s := Do(f)
	g.items = append(g.items, s)
	return s
}
673297
func GenerateDocs(apiDef *raml.APIDefinition, format, output string) error {
	switch format {
	case formatMarkdown:
		md := &markdownDocs{
			api:    apiDef,
			output: output,
		}
		return md.generate()
	default:
		return fmt.Errorf("unknown format '%s'", format)
	}
}
706990
func (s *ListFunctionDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListFunctionDefinitionsOutput {
	s.Definitions = v
	return s
}
232609
func (session *Session) Cols(columns ...string) *Session {
	session.Statement.Cols(columns...)
	return session
}
797967
func (head *Head) Vars() VarSet {
	vis := &VarVisitor{vars: VarSet{}}
	// TODO: improve test coverage for this.
	if head.Args != nil {
		Walk(vis, head.Args)
	}
	if head.Key != nil {
		Walk(vis, head.Key)
	}
	if head.Value != nil {
		Walk(vis, head.Value)
	}
	return vis.vars
}
1052655
func functions(decl *cc.Declarator) bool {
	if !strings.HasPrefix(bindgen.NameOf(decl), "cudnn") {
		return false
	}
	if decl.Type.Kind() == cc.Function {
		return true
	}
	return false

}
429644
func (p *PUPolicy) Scopes() []string {
	p.Lock()
	defer p.Unlock()

	return p.scopes
}
530870
func (at AnyType) Desc(indent, startOffset int) string {
	return cleanDescription(at.Description, indent, startOffset)
}
4806
func (e Event) Desc(lineEndComment bool, indent, startOffset int) string {
	if lineEndComment {
		return cleanDescription(e.Description, indent, startOffset)
	}
	return lowerFirst(cleanDescription(e.Description, indent, startOffset))
}
14293
func Statements(dst io.Writer, from, to model.Stmts, options ...Option) error {
	var txn bool
	for _, o := range options {
		switch o.Name() {
		case optkeyTransaction:
			txn = o.Value().(bool)
		}
	}

	ctx := newDiffCtx(from, to)

	var procs = []func(*diffCtx, io.Writer) (int64, error){
		dropTables,
		createTables,
		alterTables,
	}

	var buf bytes.Buffer
	if txn {
		buf.WriteString("\nBEGIN;\n\nSET FOREIGN_KEY_CHECKS = 0;")
	}

	for _, p := range procs {
		var pbuf bytes.Buffer
		n, err := p(ctx, &pbuf)
		if err != nil {
			return errors.Wrap(err, `failed to produce diff`)
		}
		if txn && n > 0 || !txn && buf.Len() > 0 && n > 0 {
			buf.WriteString("\n\n")
		}
		pbuf.WriteTo(&buf)
	}
	if txn {
		buf.WriteString("\n\nSET FOREIGN_KEY_CHECKS = 1;\n\nCOMMIT;")
	}

	if _, err := buf.WriteTo(dst); err != nil {
		return errors.Wrap(err, `failed to write diff`)
	}
	return nil
}
809712
func (q TemplateQuery) Vars(vars map[string]interface{}) TemplateQuery {
	q.vars = vars
	return q
}
47388
func (p *Parser) parseFields() (Fields, error) {
	var fields Fields

	for {
		// Parse the field.
		f, err := p.parseField()
		if err != nil {
			return nil, err
		}

		// Add new field.
		fields = append(fields, f)

		// If there's not a comma next then stop parsing fields.
		if tok, _, _ := p.Scan(); tok != COMMA {
			p.Unscan()
			break
		}
	}
	return fields, nil
}
1130573
func (base Base) Attrs() string {
	var ret string

	if base.ID != "" {
		ret += " id='" + base.ID + "'"
	}

	//Classes
	if len(base.Classes) != 0 {
		ret += " class='"
		ret += strings.Join(base.Classes, " ")
		ret += "'"
	}

	//Style
	if len(base.Style) != 0 {
		ret += " style='"
		var keys []string
		for key := range base.Style {
			keys = append(keys, key)
		}
		sort.Strings(keys)
		for _, val := range keys {
			ret += val + ":" + base.Style[val] + ";"
		}
		ret += "'"
	}

	var keys []string
	for key := range base.Data {
		keys = append(keys, key)
	}
	sort.Strings(keys)
	for _, key := range keys {
		ret += " " + key + "='" + base.Data[key] + "'"
	}

	return ret
}
554249
func (rw *RefWriter) WriteRefs(n ipld.Node, enc cidenc.Encoder) (int, error) {
	return rw.writeRefsRecursive(n, 0, enc)
}
1169614
func (def *PackageDef) strings() []*string {
	out := []*string{
		&def.Package,
		&def.Root,
	}
	// Important to use index here, to get a point to a real object, not its copy.
	for i := range def.Data {
		out = append(out, def.Data[i].strings()...)
	}
	return out
}