// SetGlobal pops a value from the stack and sets it as the new value of
// global name.
//
// http://www.lua.org/manual/5.2/manual.html#lua_setglobal
549048
func (l *State) SetGlobal(name string) {
	l.checkElementCount(1)
	g := l.global.registry.atInt(RegistryIndexGlobals)
	l.push(name)
	l.setTableAt(g, l.stack[l.top-1], l.stack[l.top-2])
	l.top -= 2 // pop value and key
}
319341
func (s *CreateGlobalClusterInput) SetGlobalClusterIdentifier(v string) *CreateGlobalClusterInput {
	s.GlobalClusterIdentifier = &v
	return s
}
1041644
func newGlobal() *Global {
	return &Global{
		MainThread: nil,
		Registry:   newLTable(0, 32),
		Global:     newLTable(0, 64),
		builtinMts: make(map[int]LValue),
		tempFiles:  make([]*os.File, 0, 10),
	}
}
104827
func (s *ScheduleRunConfiguration) SetLocale(v string) *ScheduleRunConfiguration {
	s.Locale = &v
	return s
}
778959
func (i *Instance) setGlobalRules() error {

	cfg, err := i.newACLInfo(0, "", nil, 0)
	if err != nil {
		return err
	}

	tmpl := template.Must(template.New(globalRules).Funcs(template.FuncMap{
		"isLocalServer": func() bool {
			return i.mode == constants.LocalServer
		},
	}).Parse(globalRules))

	rules, err := extractRulesFromTemplate(tmpl, cfg)
	if err != nil {
		zap.L().Warn("unable to extract rules", zap.Error(err))
	}

	if err := i.processRulesFromList(rules, "Append"); err != nil {
		return fmt.Errorf("unable to install global rules:%s", err)
	}

	// nat rules cannot be templated, since they interfere with Docker.
	err = i.ipt.Insert(i.appProxyIPTableContext,
		ipTableSectionPreRouting, 1,
		"-p", "tcp",
		"-m", "addrtype", "--dst-type", "LOCAL",
		"-m", "set", "!", "--match-set", excludedNetworkSet, "src",
		"-j", natProxyInputChain)
	if err != nil {
		return fmt.Errorf("unable to add default allow for marked packets at net: %s", err)
	}

	err = i.ipt.Insert(i.appProxyIPTableContext,
		ipTableSectionOutput, 1,
		"-m", "set", "!", "--match-set", excludedNetworkSet, "dst",
		"-j", natProxyOutputChain)
	if err != nil {
		return fmt.Errorf("unable to add default allow for marked packets at net: %s", err)
	}

	return nil
}
116534
func SetGlobalMachineID(id int) error {
	if id > 1023 || id < 0 {
		return ErrGlobalIDBadVal
	}
	globalmachineID.Lock()
	globalmachineID.id = id
	globalmachineID.set = true
	globalmachineID.Unlock()
	return nil
}
178599
func (s *DeleteGlobalClusterInput) SetGlobalClusterIdentifier(v string) *DeleteGlobalClusterInput {
	s.GlobalClusterIdentifier = &v
	return s
}
516661
func SetGlobalVariable(endpoint, key string, value interface{}) error {
	var inst *Instance
	var exists bool
	if inst, exists = connectionPool[endpoint]; !exists {
		return errNotRegistered
	}
	if !globalKeyExp.MatchString(key) {
		return errKeyInvalid
	}
	if _, err := inst.connection.Exec(fmt.Sprintf("SET GLOBAL %s=?", key), value); err != nil {
		return err
	}
	return nil
}
832605
func (s *CreateGlobalTableInput) SetGlobalTableName(v string) *CreateGlobalTableInput {
	s.GlobalTableName = &v
	return s
}
336658
func (s *GlobalTableDescription) SetGlobalTableArn(v string) *GlobalTableDescription {
	s.GlobalTableArn = &v
	return s
}
914452
func SetGLogLevel(glogLevel int) {
	_ = flag.CommandLine.Parse([]string{})
	_ = flag.Lookup("logtostderr").Value.Set("true")
	_ = flag.Lookup("v").Value.Set(strconv.Itoa(glogLevel))
}
1006999
func (s *UpdateGlobalTableInput) SetGlobalTableName(v string) *UpdateGlobalTableInput {
	s.GlobalTableName = &v
	return s
}
432450
func (s *DescribeExclusionsInput) SetLocale(v string) *DescribeExclusionsInput {
	s.Locale = &v
	return s
}
24136
func (s *UpdatePatchBaselineInput) SetGlobalFilters(v *PatchFilterGroup) *UpdatePatchBaselineInput {
	s.GlobalFilters = v
	return s
}
698111
func (s *PutBotInput) SetLocale(v string) *PutBotInput {
	s.Locale = &v
	return s
}
311663
func setGlobalsFromContext(ctx *cli.Context) error {
	quiet := ctx.IsSet("quiet")
	debug := ctx.IsSet("debug")
	json := ctx.IsSet("json")
	noColor := ctx.IsSet("no-color")
	insecure := ctx.IsSet("insecure")
	setGlobals(quiet, debug, json, noColor, insecure)
	return nil
}
30178
func (m *Mrb) SetGlobalVariable(name string, value Value) {
	cs := C.CString(name)
	defer C.free(unsafe.Pointer(cs))

	v := value.MrbValue(m)
	C._go_mrb_gv_set(m.state, C.mrb_intern_cstr(m.state, cs), v.value)
}