// Synth adds a synth to a group
187167
func (g *GroupNode) Synth(defName string, id, action int32, ctls map[string]float32) (*Synth, error) {
	return g.client.Synth(defName, id, action, g.id, ctls)
}
1277780
func (g *Mutable) Add(v, w int) {
	g.AddCost(v, w, 0)
}
133156
func (g *GroupOperations) Call(fn string, args ...interface{}) {
	g.e.callGroupMethod(g.relay, g.group, fn, args...)
}
498237
func (ag *ArgGroup) ArgString() string {
	args := make([]string, len(ag.grp))
	for i, arg := range ag.grp {
		args[i] = arg.ArgString()
	}
	return strings.Join(args, "|")
}
36535
func Group(group string) (*apimachinery.GroupMeta, error) {
	groupMeta, found := groupMetaMap[group]
	if !found {
		return nil, fmt.Errorf("group %v has not been registered", group)
	}
	groupMetaCopy := *groupMeta
	return &groupMetaCopy, nil
}
893761
func (l *Log) Group() Group {
	return &group{
		lines: make([]*line, 0),
		log:   l,
		quiet: l.quiet,
	}
}
489607
func (c *Command) GroupOptions(names ...string) OptionGroup {
	var group OptionGroup
	for _, n := range names {
		o := c.Option(n)
		if o == nil {
			panicCommand("Option not found: %s", n)
		}
		group.Options = append(group.Options, o)
	}
	return group
}
1100553
func (m *M) AddFunc(mimetype string, minifier MinifierFunc) {
	m.mutex.Lock()
	m.literal[mimetype] = minifier
	m.mutex.Unlock()
}
450465
func (g *Generator) Generate() (_ []string, err error) {
	if g.API == nil {
		return nil, fmt.Errorf("missing API definition, make sure design is properly initialized")
	}

	go utils.Catch(nil, func() { g.Cleanup() })

	defer func() {
		if err != nil {
			g.Cleanup()
		}
	}()

	if g.Target == "" {
		g.Target = "app"
	}

	codegen.Reserved[g.Target] = true

	mainFile := filepath.Join(g.OutDir, "main.go")
	if g.Force {
		os.Remove(mainFile)
	}
	_, err = os.Stat(mainFile)
	if err != nil {
		// ensure that the output directory exists before creating a new main
		if err = os.MkdirAll(g.OutDir, 0755); err != nil {
			return nil, err
		}
		if err = g.createMainFile(mainFile, funcMap(g.Target, nil)); err != nil {
			return nil, err
		}
	}

	err = g.API.IterateResources(func(r *design.ResourceDefinition) error {
		filename, err := GenerateController(g.Force, g.Regen, g.Target, g.OutDir, "main", r.Name, r)
		if err != nil {
			return err
		}

		g.genfiles = append(g.genfiles, filename)
		return nil
	})
	if err != nil {
		return
	}

	return g.genfiles, nil
}
398178
func ToGroupMode(fluxMode flux.GroupMode) GroupMode {
	switch fluxMode {
	case flux.GroupModeNone:
		return GroupModeDefault
	case flux.GroupModeBy:
		return GroupModeBy
	case flux.GroupModeExcept:
		return GroupModeExcept
	default:
		panic(fmt.Sprint("unknown group mode: ", fluxMode))
	}
}
975064
func (g *GroupComposer) String() string {
	if len(g.messages) == 1 && g.messages[0].Loggable() {
		return g.messages[0].String()

	}

	out := []string{}
	for _, m := range g.messages {
		if m == nil {
			continue
		}
		if m.Loggable() {
			out = append(out, m.String())
		}
	}

	return strings.Join(out, "\n")
}
375589
func Generate() ([]string, error) {
	var (
		ver    string
		outDir string
	)
	set := flag.NewFlagSet("app", flag.PanicOnError)
	set.String("design", "", "") // Consume design argument so Parse doesn't complain
	set.StringVar(&ver, "version", "", "")
	set.StringVar(&outDir, "out", "", "")
	set.Parse(os.Args[2:])
	// First check compatibility
	if err := codegen.CheckVersion(ver); err != nil {
		return nil, err
	}
	return writeFunctions(design.Design, outDir)
}
829224
func (g *Generator) Generate() (_ []string, err error) {
	if g.API == nil {
		return nil, fmt.Errorf("missing API definition, make sure design is properly initialized")
	}

	go utils.Catch(nil, func() { g.Cleanup() })

	defer func() {
		if err != nil {
			g.Cleanup()
		}
	}()

	s := APISchema(g.API)
	js, err := s.JSON()
	if err != nil {
		return
	}

	g.OutDir = filepath.Join(g.OutDir, "schema")
	os.RemoveAll(g.OutDir)
	os.MkdirAll(g.OutDir, 0755)
	g.genfiles = append(g.genfiles, g.OutDir)
	schemaFile := filepath.Join(g.OutDir, "schema.json")
	if err = ioutil.WriteFile(schemaFile, js, 0644); err != nil {
		return
	}
	g.genfiles = append(g.genfiles, schemaFile)

	return g.genfiles, nil
}
780850
func (s *SVG) Group(elements [2]string, args map[string]interface{}) {
	s.svgString += fmt.Sprintf("<g %s>", s.WriteArgs(args))
	s.svgString += elements[0] + elements[1]
	s.svgString += "</g>"
}
1074608
func (c *Client) Synth(defName string, id, action, target int32, ctls map[string]float32) (*Synth, error) {
	msg := osc.Message{
		Address: synthNewAddress,
		Arguments: osc.Arguments{
			osc.String(defName),
			osc.Int(id),
			osc.Int(action),
			osc.Int(target),
		},
	}
	if ctls != nil {
		for k, v := range ctls {
			msg.Arguments = append(msg.Arguments, osc.String(k))
			msg.Arguments = append(msg.Arguments, osc.Float(v))
		}
	}
	if err := c.oscConn.Send(msg); err != nil {
		return nil, err
	}
	return newSynth(c, defName, id), nil
}
147063
func (u *Ugen) Write(w io.Writer) error {
	// write the synthdef name
	if err := newPstring(u.Name).Write(w); err != nil {
		return err
	}
	// write rate
	if err := binary.Write(w, byteOrder, u.Rate); err != nil {
		return err
	}
	// write inputs
	numInputs := int32(len(u.Inputs))
	if err := binary.Write(w, byteOrder, numInputs); err != nil {
		return err
	}
	// write outputs
	numOutputs := int32(len(u.Outputs))
	if err := binary.Write(w, byteOrder, numOutputs); err != nil {
		return err
	}
	// special index
	if err := binary.Write(w, byteOrder, u.SpecialIndex); err != nil {
		return err
	}
	// inputs
	for _, i := range u.Inputs {
		if err := i.Write(w); err != nil {
			return err
		}
	}
	// outputs
	for _, o := range u.Outputs {
		if err := o.Write(w); err != nil {
			return err
		}
	}
	return nil
}
419572
func (g *Group) SwitchFunc(f func(*Group)) *Statement {
	s := SwitchFunc(f)
	g.items = append(g.items, s)
	return s
}