// LeftRight Return left, right values if is of form `table.column` or `schema`.`table`
// also return true/false for if it even has left/right
975332
func LeftRight(val string) (string, string, bool) {
	if len(val) < 2 {
		return "", val, false
	}
	switch by := val[0]; by {
	case '`':
		vals := strings.Split(val, "`.`")
		if len(vals) == 1 {
			return "", IdentityTrim(val), false
		} else if len(vals) == 2 {
			return IdentityTrim(vals[0]), IdentityTrim(vals[1]), true
		}
		// wat, no idea what this is
		return "", val, false
	case '[':
		vals := strings.Split(val, "].[")
		if len(vals) == 1 {
			return "", IdentityTrim(val), false
		} else if len(vals) == 2 {
			return IdentityTrim(vals[0]), IdentityTrim(vals[1]), true
		}
		// wat, no idea what this is
		return "", val, false
	default:
		vals := strings.SplitN(val, ".", 2)
		if len(vals) == 1 {
			return "", val, false
		} else if len(vals) == 2 {
			return IdentityTrim(vals[0]), IdentityTrim(vals[1]), true
		}
	}

	return "", val, false
}
387087
func (claims *Claims) ComponentRight(componentID string, right types.Right) bool {
	return claims.ComponentAccess(componentID) && containsRight(claims.Components[componentID], right)
}
202976
func In(col I, values ...interface{}) Condition {
	return Condition{
		Type:  ConditionIn,
		Left:  NewOperand(col),
		Right: NewOperand(values...),
	}
}
580423
func equalFoldRight(s, t []byte) bool {
	for _, sb := range s {
		if len(t) == 0 {
			return false
		}
		tb := t[0]
		if tb < utf8.RuneSelf {
			if sb != tb {
				sbUpper := sb & caseMask
				if 'A' <= sbUpper && sbUpper <= 'Z' {
					if sbUpper != tb&caseMask {
						return false
					}
				} else {
					return false
				}
			}
			t = t[1:]
			continue
		}
		// sb is ASCII and t is not. t must be either kelvin
		// sign or long s; sb must be s, S, k, or K.
		tr, size := utf8.DecodeRune(t)
		switch sb {
		case 's', 'S':
			if tr != smallLongEss {
				return false
			}
		case 'k', 'K':
			if tr != kelvin {
				return false
			}
		default:
			return false
		}
		t = t[size:]

	}
	if len(t) > 0 {
		return false
	}
	return true
}
1008747
func PadRight(s, pad string, width int) string {
	gap := width - DisplayWidth(s)
	if gap > 0 {
		return s + strings.Repeat(string(pad), gap)
	}
	return s
}
72596
func Ne(left, right interface{}) Condition {
	return Condition{
		Type:  ConditionNe,
		Left:  NewOperand(left),
		Right: NewOperand(right),
	}
}
306088
func (t *TextBar) SetRight(s string, style tcell.Style) {
	t.initialize()
	if style == tcell.StyleDefault {
		style = t.style
	}
	t.right.SetText(s)
	t.right.SetStyle(style)
}
1135834
func Right(a []int, v int) int {
	return bisectRightRange(a, v, 0, len(a))
}
729258
func (left labelList) Equivalent(right labelList) bool {
	if len(left) != len(right) {
		return false
	} else {
		for i := range left {
			found := false
			for j := range right {
				if left[i].Equivalent(right[j]) {
					found = true
					break
				}
			}
			if !found {
				return false
			}
		}
		return true
	}
}
904354
func (s Seq) FoldRight(mapfn func(i int, v0, v float64) float64) (v0 float64) {
	if s.Len() == 0 {
		return 0
	}

	if s.Len() == 1 {
		return s.GetValue(0)
	}

	v0 = s.GetValue(s.Len() - 1)
	for i := s.Len() - 2; i >= 0; i-- {
		v0 = mapfn(i, v0, s.GetValue(i))
	}
	return
}
954780
func (q *Query) LeftInnerJoin(table string, on string, args ...interface{}) *Query {
	oncer.Deprecate(0, "pop.Query#LeftInnerJoin", "Use pop.Query#InnerJoin instead.")
	return q.InnerJoin(table, on, args...)
}
160608
func (this *token_iterator) skip_to_left_curly() bool {
	return this.skip_to_left(token.LBRACE, token.RBRACE)
}
759345
func (t *Table) RightJoinOn(
	table ReadableTable,
	onCondition BoolExpression) ReadableTable {

	return RightJoinOn(t, table, onCondition)
}
362736
func (k *AccessKey) HasRight(right Right) bool {
	for _, r := range k.Rights {
		if r == right {
			return true
		}
	}
	return false
}
575822
func padRight(in, pad string, length int) string {
	for {
		in += pad
		if len(in) > length {
			return in[0:length]
		}
	}
}
975511
func PadRight(str string, length int, pad byte) string {
	if len(str) >= length {
		return str
	}
	buf := bytes.NewBufferString(str)
	for i := 0; i < length-len(str); i++ {
		buf.WriteByte(pad)
	}
	return buf.String()
}
36508
func (b *SelectStmt) RightJoin(table, on interface{}) *SelectStmt {
	b.JoinTable = append(b.JoinTable, join(right, table, on))
	return b
}