// InterpretSequenceSet creates a SequenceSet from the given string in the IMAP
// format.
542905
func InterpretSequenceSet(imapSequenceSet string) (seqSet SequenceSet, err error) {
	// Ensure the sequence set is valid
	if !setRegexp.MatchString(imapSequenceSet) {
		return nil, errInvalidSequenceSetString(imapSequenceSet)
	}

	ranges := strings.Split(imapSequenceSet, ",")

	seqSet = make(SequenceSet, len(ranges))
	for index, rng := range ranges {
		seqSet[index], err = InterpretMessageRange(rng)
		if err != nil {
			return seqSet, err
		}
	}

	return seqSet, nil
}
348008
func (q *EvictingStringQueue) PeekAllSet() map[string]bool {
	all := q.PeekAll()
	set := make(map[string]bool)
	for _, v := range all {
		set[v] = true
	}

	return set
}
684890
func (me *TxsdPlatformTypeChoiceCompleteGenomicsSequenceInstrumentModel) Set(s string) {
	(*xsdt.String)(me).Set(s)
}
1303194
func (s *StreamRecord) SetSequenceNumber(v string) *StreamRecord {
	s.SequenceNumber = &v
	return s
}
1022822
func parseTS(str string) time.Time {
	t := time.Time{}

	if sec, err := strconv.ParseInt(str, 10, 64); err == nil {
		t = time.Unix(sec, 0)
	}

	return t
}
245437
func (c *Color) sequence() string {
	format := make([]string, len(c.params))
	for i, v := range c.params {
		format[i] = strconv.Itoa(int(v))
	}

	return strings.Join(format, ";")
}
1227984
func mergeSequences(seq *sequence) {
	if seq != nil {
		// Merge all what possible from seq
		for seq.next != nil && seq.block == seq.next.block {
			seq.count += seq.next.count
			seq.next = seq.next.next
		}
		// Move to next
		mergeSequences(seq.next)
	}
}
671970
func (s SeqSet) String() string {
	if len(s.Set) == 0 {
		return ""
	}
	b := make([]byte, 0, 64)
	for _, v := range s.Set {
		b = append(b, ',')
		if v.Start == 0 {
			b = append(b, '*')
			continue
		}
		b = strconv.AppendUint(b, uint64(v.Start), 10)
		if v.Start != v.Stop {
			if v.Stop == 0 {
				b = append(b, ':', '*')
				continue
			}
			b = strconv.AppendUint(append(b, ':'), uint64(v.Stop), 10)
		}
	}
	return string(b[1:])
}
1132458
func (me *TxsdSubmissionTypeSequenceActionsSequenceActionChoiceModifySchema) Set(s string) {
	(*xsdt.String)(me).Set(s)
}
1099797
func ParseStringSet(s string) (*StringSet, error) {
	ss := &StringSet{}
	if s == "" {
		return nil, errors.New("cannot be empty")
	}

	*ss = strings.Split(s, ",")

	return ss, nil
}
499335
func (c *asyncClient) Lset(arg0 string, arg1 int64, arg2 []byte) (stat FutureBool, err Error) {
	arg0bytes := []byte(arg0)
	arg1bytes := []byte(strconv.FormatInt(arg1, 10))
	arg2bytes := arg2

	resp, err := c.conn.QueueRequest(&LSET, [][]byte{arg0bytes, arg1bytes, arg2bytes})
	if err == nil {
		stat = resp.future.(FutureBool)
	}

	return
}
875647
func (m *Message) decodeSet() (err error) {
	pd := realDecoder{raw: m.Value}
	m.Set = &MessageSet{}
	return m.Set.decode(&pd)
}
1146109
func newStringSet(keys ...string) stringSet {
	ss := make(stringSet, len(keys))
	ss.add(keys...)
	return ss
}
1142750
func parseCharacterSet(cs string) (uint8, error) {
	// Check if it's empty, return utf8. This is a reasonable default.
	if cs == "" {
		return CharacterSetUtf8, nil
	}

	// Check if it's in our map.
	characterSet, ok := CharacterSetMap[strings.ToLower(cs)]
	if ok {
		return characterSet, nil
	}

	// As a fallback, try to parse a number. So we support more values.
	if i, err := strconv.ParseInt(cs, 10, 8); err == nil {
		return uint8(i), nil
	}

	// No luck.
	return 0, NewSQLError(CRCantReadCharset, SSUnknownSQLState, "failed to interpret character set '%v'. Try using an integer value if needed", cs)
}
535839
func NewStringSet(vs ...string) StringSet {
	s := &stringSet{make(map[string]struct{})}
	s.Add(vs...)
	return s
}
1082463
func (s *DiscoverySupport) ConfigSequence(channel string) uint64 {
	// No sequence if the channel is empty
	if channel == "" {
		return 0
	}
	conf := s.GetChannelConfig(channel)
	if conf == nil {
		logger.Panic("Failed obtaining channel config for channel", channel)
	}
	v := conf.ConfigtxValidator()
	if v == nil {
		logger.Panic("ConfigtxValidator for channel", channel, "is nil")
	}
	return v.Sequence()
}
957435
func (me *TxsdSequencingDirectivesTypeAllSampleDemuxDirective) Set(s string) {
	(*xsdt.String)(me).Set(s)
}