// Neg sets q to the negative value of y.
// It updates the format of q to match y.
975951
func (q *Quantity) Neg(y Quantity) error {
	switch {
	case y.Amount == nil:
		*q = y
	case q.Amount == nil:
		q.Amount = &inf.Dec{}
		fallthrough
	default:
		q.Amount.Neg(y.Amount)
		q.Format = y.Format
	}
	return nil
}
1341756
func (b ValExprBuilder) Neq(val interface{}) BoolExprBuilder {
	return b.makeComparisonExpr(astNE, makeValExpr(val))
}
1104901
func AskYesNo(question string, noIsDefault bool) bool {
	var s string
	alternatives := "Yn"
	if noIsDefault {
		alternatives = "yN"
	}
	fmt.Printf(question + " [" + alternatives + "] ")
	fmt.Scanf("%s", &s)
	if noIsDefault {
		// Anything that isn't yes is "no" (false)
		return s == "Y" || s == "y"
	}
	// Anything that isn't no is "yes" (true)
	return !(s == "N" || s == "n")
}
899399
func NewArg(key string, val interface{}) *Arg {
	switch val {
	case false:
		val = "0"
	case true:
		val = "1"
	}
	return &Arg{key: key, val: fmt.Sprint(val)}
}
1079396
func (s *Set) Arg(n int) string {
	if n >= 0 && n < len(s.args) {
		return s.args[n]
	}
	return ""
}
1122842
func (s *Condition) SetNeq(v []*string) *Condition {
	s.Neq = v
	return s
}
418575
func (as ArraySpec) Neg() Input {
	return as.proc(func(i Input) Input {
		return i.Neg()
	})
}
127811
func GenerateSlug(str string) (slug string) {
	return strings.Map(func(r rune) rune {
		switch {
		case r == ' ', r == '-':
			return '-'
		case r == '_', unicode.IsLetter(r), unicode.IsDigit(r):
			return r
		default:
			return -1
		}
		return -1
	}, strings.ToLower(strings.TrimSpace(str)))
}
1345647
func (q Quad) NQuad() string {
	if q.Label == nil || q.Label.String() == "" {
		return fmt.Sprintf("%s %s %s .", q.Subject, q.Predicate, q.Object)
	}
	return fmt.Sprintf("%s %s %s %s .", q.Subject, q.Predicate, q.Object, q.Label)
}
954906
func (p *parser) negation(t *Token) (Pattern, Error) {
	// a negation appears before a path specification, so
	// skip the negation token
	_next, _err := p.next()
	if _err != nil {
		return nil, _err
	}

	// extract the sequence of tokens for this path
	_tokens, _err := p.sequence(_next)
	if _err != nil {
		return nil, _err
	}

	// include the "negation" token at the front of the sequence
	_tokens = append([]*Token{t}, _tokens...)

	// return the Pattern instance
	return NewPattern(_tokens), nil
}
921276
func (s *UpdateByQueryService) Q(q string) *UpdateByQueryService {
	s.q = q
	return s
}
261687
func (e *G1) Neg(a *G1) *G1 {
	if e.p == nil {
		e.p = &curvePoint{}
	}
	e.p.Neg(a.p)
	return e
}
202043
func fmtE(dst EncodingBuffer, neg bool, d decimalSlice, prec int, fmt byte) {
	// sign
	if neg {
		dst.WriteByte('-')
	}

	// first digit
	ch := byte('0')
	if d.nd != 0 {
		ch = d.d[0]
	}
	dst.WriteByte(ch)

	// .moredigits
	if prec > 0 {
		dst.WriteByte('.')
		i := 1
		m := min(d.nd, prec+1)
		if i < m {
			dst.Write(d.d[i:m])
			i = m
		}
		for i <= prec {
			dst.WriteByte('0')
			i++
		}
	}

	// e±
	dst.WriteByte(fmt)
	exp := d.dp - 1
	if d.nd == 0 { // special case: 0 has exponent 0
		exp = 0
	}
	if exp < 0 {
		ch = '-'
		exp = -exp
	} else {
		ch = '+'
	}
	dst.WriteByte(ch)

	// dd or ddd
	switch {
	case exp < 10:
		dst.WriteByte('0')
		dst.WriteByte(byte(exp) + '0')
	case exp < 100:
		dst.WriteByte(byte(exp/10) + '0')
		dst.WriteByte(byte(exp%10) + '0')
	default:
		dst.WriteByte(byte(exp/100) + '0')
		dst.WriteByte(byte(exp/10)%10 + '0')
		dst.WriteByte(byte(exp%10) + '0')
	}

	return
}
745166
func (t Term) Ne(args ...interface{}) Term {
	return constructMethodTerm(t, "Ne", p.Term_NE, args, map[string]interface{}{})
}
663463
func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) {
	if h, ok := a.t.(tHelper); ok {
		h.Helper()
	}
	NotNilf(a.t, object, msg, args...)
}
515463
func (s *SentimentScore) SetNegative(v float64) *SentimentScore {
	s.Negative = &v
	return s
}
1354836
func unaryOpNeg(rate int8, in Input, numOutputs int) Input {
	CheckRate(rate)
	return NewInput(UnaryOpUgenName, rate, UnaryOpNeg, numOutputs, in)
}