// ButtonModifiers is a mouse action option to add additional input modifiers
// for a button click.
342732
func ButtonModifiers(modifiers ...input.Modifier) MouseOption {
	return func(p *input.DispatchMouseEventParams) *input.DispatchMouseEventParams {
		for _, m := range modifiers {
			p.Modifiers |= m
		}
		return p
	}
}
878127
func (buttons *Buttons) InlineButtons() InlineButtons {
	row := InlineButtons{}

	for _, button := range *buttons {
		row.Append(button.Data, button.Text)

	}
	return row
}
70261
func mouseKeys(xu *xgbutil.XUtil) []xgbutil.MouseKey {
	xu.MousebindsLck.RLock()
	defer xu.MousebindsLck.RUnlock()

	keys := make([]xgbutil.MouseKey, len(xu.Mousebinds))
	i := 0
	for key, _ := range xu.Mousebinds {
		keys[i] = key
		i++
	}
	return keys
}
1040499
func execModifier(json, path string) (pathOut, res string, ok bool) {
	name := path[1:]
	var hasArgs bool
	for i := 1; i < len(path); i++ {
		if path[i] == ':' {
			pathOut = path[i+1:]
			name = path[1:i]
			hasArgs = len(pathOut) > 0
			break
		}
		if !DisableChaining {
			if path[i] == '|' {
				pathOut = path[i:]
				name = path[1:i]
				break
			}
		}
	}
	if fn, ok := modifiers[name]; ok {
		var args string
		if hasArgs {
			var parsedArgs bool
			switch pathOut[0] {
			case '{', '[', '"':
				res := Parse(pathOut)
				if res.Exists() {
					_, args = parseSquash(pathOut, 0)
					pathOut = pathOut[len(args):]
					parsedArgs = true
				}
			}
			if !parsedArgs {
				idx := -1
				if !DisableChaining {
					idx = strings.IndexByte(pathOut, '|')
				}
				if idx == -1 {
					args = pathOut
					pathOut = ""
				} else {
					args = pathOut[:idx]
					pathOut = pathOut[idx:]
				}
			}
		}
		return pathOut, fn(json, args), true
	}
	return pathOut, res, false
}
498333
func (reader *PluginConfigReader) GetModulatorArray(key string, logger logrus.FieldLogger, defaultValue ModulatorArray) ModulatorArray {
	modulators, err := reader.WithError.GetModulatorArray(key, logger, defaultValue)
	reader.Errors.Push(err)
	return modulators
}
1019132
func (a *DispatchTouchEventArgs) SetModifiers(modifiers int) *DispatchTouchEventArgs {
	a.Modifiers = &modifiers
	return a
}
23308
func (formatterModulator *FormatterModulator) Modulate(msg *Message) ModulateResult {
	err := formatterModulator.ApplyFormatter(msg)
	if err != nil {
		logrus.Warning("FormatterModulator with error:", err)
		return ModulateResultDiscard
	}

	return ModulateResultContinue
}
515939
func (v *VerbalExpression) removemodifier(f Flag) *VerbalExpression {
	v.compiled = false //reinit previous regexp compilation
	v.flags &= ^f
	return v
}
992266
func AddInputs(inputs ...InputWithScript) UpdateOption {
	return func(uo *updateOptions) {
		uo.inputs = append(uo.inputs, inputs...)
	}
}
672911
func (s *HeadObjectInput) SetIfUnmodifiedSince(v time.Time) *HeadObjectInput {
	s.IfUnmodifiedSince = &v
	return s
}
618823
func (r Layout_Profile) ModifyPreferences(layoutPreferenceObjects []datatypes.Layout_Profile_Preference) (resp []datatypes.Layout_Profile_Preference, err error) {
	params := []interface{}{
		layoutPreferenceObjects,
	}
	err = r.Session.DoRequest("SoftLayer_Layout_Profile", "modifyPreferences", params, &r.Options, &resp)
	return
}
672884
func (s *ChannelSpecification) SetSupportedInputModes(v []*string) *ChannelSpecification {
	s.SupportedInputModes = v
	return s
}
941143
func (c *Cache) LockedModify(u interface{}, add func(a, b interface{}) interface{}, increment interface{}) (interface{}, error) {

	var timer *time.Timer
	if c.lifetime != -1 {
		timer = time.AfterFunc(c.lifetime, func() {
			if err := c.removeNotify(u, true); err != nil {
				zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
			}
		})
	}

	t := time.Now()

	c.Lock()
	defer c.Unlock()

	e, ok := c.data[u]
	if !ok {
		return nil, errors.New("not found")
	}

	if e.timer != nil {
		e.timer.Stop()
	}

	e.value = add(e.value, increment)
	e.timer = timer
	e.timestamp = t
	e.expirer = c.expirer

	c.data[u] = e

	return e.value, nil

}
237277
func (a *EmulateTouchFromMouseEventArgs) SetModifiers(modifiers int) *EmulateTouchFromMouseEventArgs {
	a.Modifiers = &modifiers
	return a
}
973237
func MouseToggle(togKey string, args ...interface{}) {
	var button C.MMMouseButton = C.LEFT_BUTTON

	if len(args) > 0 {
		button = CheckMouse(args[0].(string))
	}

	down := C.CString(togKey)
	C.mouse_toggle(down, button)

	C.free(unsafe.Pointer(down))
}
1304976
func (m *ModelManagerAPI) ModifyModelAccess(args params.ModifyModelAccessRequest) (result params.ErrorResults, _ error) {
	result = params.ErrorResults{
		Results: make([]params.ErrorResult, len(args.Changes)),
	}

	canModifyController, err := m.authorizer.HasPermission(permission.SuperuserAccess, m.state.ControllerTag())
	if err != nil {
		return result, errors.Trace(err)
	}
	if len(args.Changes) == 0 {
		return result, nil
	}

	for i, arg := range args.Changes {
		modelAccess := permission.Access(arg.Access)
		if err := permission.ValidateModelAccess(modelAccess); err != nil {
			err = errors.Annotate(err, "could not modify model access")
			result.Results[i].Error = common.ServerError(err)
			continue
		}

		modelTag, err := names.ParseModelTag(arg.ModelTag)
		if err != nil {
			result.Results[i].Error = common.ServerError(errors.Annotate(err, "could not modify model access"))
			continue
		}
		canModifyModel, err := m.authorizer.HasPermission(permission.AdminAccess, modelTag)
		if err != nil {
			return result, errors.Trace(err)
		}
		canModify := canModifyController || canModifyModel

		if !canModify {
			result.Results[i].Error = common.ServerError(common.ErrPerm)
			continue
		}

		targetUserTag, err := names.ParseUserTag(arg.UserTag)
		if err != nil {
			result.Results[i].Error = common.ServerError(errors.Annotate(err, "could not modify model access"))
			continue
		}

		result.Results[i].Error = common.ServerError(
			changeModelAccess(m.state, modelTag, m.apiUser, targetUserTag, arg.Action, modelAccess, m.isAdmin))
	}
	return result, nil
}
915383
func (s *HlsOutputSettings) SetSegmentModifier(v string) *HlsOutputSettings {
	s.SegmentModifier = &v
	return s
}