// PrependWithState add the InlineButton with state to the begin of InlineButtons(row)
// Useful for checkbox or to revert the action
547185
func (buttons *InlineButtons) PrependWithState(state int, data string, text string) {
	if len(data) > 64 {
		log.WithField("text", text).Errorf("InlineButton data '%s' extends 64 bytes limit", data)
	}
	if state > 9 || state < 0 {
		log.WithField("data", data).WithField("text", text).Errorf("PrependWithState – state must be [0-9], %d received", state)
	}
	*buttons = append([]InlineButton{{Data: data, Text: text, State: state}}, *buttons...)
}
830025
func (p *PlanTierParams) AppendTo(body *form.Values, keyParts []string) {
	if BoolValue(p.UpToInf) {
		body.Add(form.FormatKey(append(keyParts, "up_to")), "inf")
	} else {
		body.Add(form.FormatKey(append(keyParts, "up_to")), strconv.FormatInt(Int64Value(p.UpTo), 10))
	}
}
878127
func (buttons *Buttons) InlineButtons() InlineButtons {
	row := InlineButtons{}

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

	}
	return row
}
527207
func (ps *PassState) WithComment(comment string) TransitionState {
	ps.comment = comment
	return ps
}
457452
func (win *Window) CustomState() nstyle.WidgetStates {
	bounds := win.WidgetBounds()
	s := true
	if !win.layout.Clip.Intersect(&bounds) {
		s = false
	}

	ws := win.widgets.PrevState(bounds)
	basicWidgetStateControl(&ws, win.inputMaybe(s), bounds)
	return ws
}
1007575
func (s *Selection) PrependNodes(ns ...*html.Node) *Selection {
	return s.manipulateNodes(ns, true, func(sn *html.Node, n *html.Node) {
		// sn.FirstChild may be nil, in which case this functions like
		// sn.AppendChild()
		sn.InsertBefore(n, sn.FirstChild)
	})
}
1114412
func (buttons *InlineButtons) Markup(columns int, state string) InlineKeyboard {
	keyboard := InlineKeyboard{}

	col := 0

	row := InlineButtons{}
	len := len(*buttons)
	for i, button := range *buttons {
		row = append(row, button)

		col++
		if col == columns || i == (len-1) {
			col = 0
			keyboard.AppendRows(row)
			row = InlineButtons{}
		}
	}
	keyboard.State = state
	return keyboard
}
1020565
func (p *ProtoCommands) GenInitialState() gopter.Gen {
	return p.InitialStateGen.SuchThat(func(state State) bool {
		return p.InitialPreCondition(state)
	})
}
146521
func (s *store) initState() error {
	var err error
	var blist lastUpdatedOldBlocksList
	if s.isEmpty, s.lastCommittedBlock, err = s.getLastCommittedBlockNum(); err != nil {
		return err
	}
	if s.batchPending, err = s.hasPendingCommit(); err != nil {
		return err
	}
	if blist, err = s.getLastUpdatedOldBlocksList(); err != nil {
		return err
	}
	if len(blist) > 0 {
		s.isLastUpdatedOldBlocksSet = true
	} // false if not set

	return nil
}
398065
func (q Query) Prepend(item interface{}) Query {
	return Query{
		Iterate: func() Iterator {
			next := q.Iterate()
			prepended := false

			return func() (interface{}, bool) {
				if prepended {
					return next()
				}

				prepended = true
				return item, true
			}
		},
	}
}
1048243
func (cAppender *consoleAppender) Append(event *Event) (ok bool) {
	ok = false
	defer gorivets.EndQuietly()
	msg := ToLogMessage(event, cAppender.layoutTemplate)
	if cAppender.async {
		caFactory.msgChannel <- msg
	} else {
		caFactory.write(msg)
	}
	ok = caFactory.msgChannel != nil
	return ok
}
605101
func InitState(key string, value interface{}) Option {
	return func(p *parser) Option {
		old := p.cur.state[key]
		p.cur.state[key] = value
		return InitState(key, old)
	}
}
637335
func (cs *ChoiceState) WithDefault(defaultState TransitionState) *ChoiceState {
	cs.Default = defaultState
	return cs
}
83306
func (t *Tag) Prepend(b ...Body) {
	t.Body = append(b, t.Body...)
}
747445
func (h Handler) Prepend(cmd common.SetRequest) error {
	return h.handleAppendPrependCommon(cmd, common.RequestPrepend)
}
295561
func (f *FSM) AddInitialState(state *FSMState) {
	f.AddState(state)
	f.initialState = state
}
308493
func (wd *WaitDelay) AdjacentStates() []MachineState {
	if wd.next == nil {
		return nil
	}
	return []MachineState{wd.next}
}