// logSepcials checks for special values (Inf, NaN, 0) for logarithms.
770984
func logSpecials(z, x *decimal.Big) bool {
	if z.CheckNaNs(x, nil) {
		return true
	}

	if sgn := x.Sign(); sgn <= 0 {
		if sgn == 0 {
			// ln 0 = -Inf
			z.SetInf(true)
		} else {
			// ln -x is undefined.
			z.Context.Conditions |= decimal.InvalidOperation
			z.SetNaN(false)
		}
		return true
	}

	if x.IsInf(+1) {
		// ln +Inf = +Inf
		z.SetInf(false)
		return true
	}
	return false
}
1062624
func (r *Route) LogFields() logrus.Fields {
	return logrus.Fields{
		"prefix":            r.Prefix,
		"nexthop":           r.Nexthop,
		"local":             r.Local,
		logfields.Interface: r.Device,
	}
}
163916
func InitLogs() {
	log.SetOutput(KlogWriter{})
	log.SetFlags(0)
	// The default glog flush interval is 5 seconds.
	go wait.Until(klog.Flush, *logFlushFreq, wait.NeverStop)
}
543563
func logStats(stats *responseStats, interval uint) {
	logrus.Debugf("Initializing stats reporting. Will print stats once/%d seconds", interval)
	if interval == 0 {
		// interval of 0 means don't print summary status
		return
	}
	ticker := time.NewTicker(time.Second * time.Duration(interval))
	for range ticker.C {
		stats.logAndReset()
	}
}
41490
func Logspace(lo, hi float64, num int, base float64) []float64 {
	res := Linspace(lo, hi, num)
	for i, x := range res {
		res[i] = math.Pow(base, x)
	}
	return res
}
1010534
func ParseDeps(deps []string) ([]*Dependency, error) {
	var err error
	dependencies := make([]*Dependency, 0)

	for _, dep := range deps {
		dependencies, err = parseDependency(dep, dependencies)
		if err != nil {
			return nil, err
		}
	}

	return dependencies, nil
}
608443
func ParseOpts(opts ...interface{}) (time.Duration, logging.Logger) {
	timeout := DefaultMsgTimeout
	var logger logging.Logger = logrus.DefaultLogger()

	for _, opt := range opts {
		switch opt.(type) {
		case *WithLoggerOpt:
			logger = opt.(*WithLoggerOpt).logger
		case *WithTimeoutOpt:
			timeout = opt.(*WithTimeoutOpt).timeout
		}
	}
	return timeout, logger

}
656089
func (e MultiError) NumErrors() int {
	if e.err == nil {
		return 0
	}
	return len(e.errors) + 1
}
1047817
func LogResponseCode(span opentracing.Span, code int) {
	if span != nil {
		ext.HTTPStatusCode.Set(span, uint16(code))
		if code >= 400 {
			ext.Error.Set(span, true)
		}
	}
}
1103965
func (w *SegmentWAL) LogSamples(samples []RefSample) error {
	buf := w.getBuffer()

	flag := w.encodeSamples(buf, samples)

	w.mtx.Lock()
	defer w.mtx.Unlock()

	err := w.write(WALEntrySamples, flag, buf.Get())

	w.putBuffer(buf)

	if err != nil {
		return errors.Wrap(err, "log series")
	}
	tf := w.head()

	for _, s := range samples {
		if tf.maxTime < s.T {
			tf.maxTime = s.T
		}
	}
	return nil
}
726726
func (r Scale_Group) GetLogs() (resp []datatypes.Scale_Group_Log, err error) {
	err = r.Session.DoRequest("SoftLayer_Scale_Group", "getLogs", nil, &r.Options, &resp)
	return
}
1370754
func logSSPI(format string, args ...interface{}) {
	if klog.V(5) {
		for i, arg := range args {
			if errno, ok := arg.(syscall.Errno); ok {
				args[i] = fmt.Sprintf("%v, code=%#v", errno, errno)
			}
		}
		s := fmt.Sprintf(format, args...)
		klog.InfoDepth(1, s)
	}
}
317065
func (w *SegmentWAL) LogSeries(series []RefSeries) error {
	buf := w.getBuffer()

	flag := w.encodeSeries(buf, series)

	w.mtx.Lock()
	defer w.mtx.Unlock()

	err := w.write(WALEntrySeries, flag, buf.Get())

	w.putBuffer(buf)

	if err != nil {
		return errors.Wrap(err, "log series")
	}

	tf := w.head()

	for _, s := range series {
		if tf.minSeries > s.Ref {
			tf.minSeries = s.Ref
		}
	}
	return nil
}
662559
func logAxis() {
	dumper := NewDumper("xlog1", 2, 2, 400, 300)
	defer dumper.Close()

	lc := chart.ScatterChart{}
	lc.XRange.Label, lc.YRange.Label = "X-Value", "Y-Value"
	lx := []float64{4e-2, 3e-1, 2e0, 1e1, 8e1, 7e2, 5e3}
	ly := []float64{10, 30, 90, 270, 3 * 270, 9 * 270, 27 * 270}
	lc.AddDataPair("Measurement", lx, ly, chart.PlotStylePoints,
		chart.Style{Symbol: '#', SymbolColor: color.NRGBA{0x99, 0x66, 0xff, 0xff}, SymbolSize: 1.5})
	lc.Key.Hide = true
	lc.XRange.MinMode.Expand, lc.XRange.MaxMode.Expand = chart.ExpandToTic, chart.ExpandToTic
	lc.YRange.MinMode.Expand, lc.YRange.MaxMode.Expand = chart.ExpandToTic, chart.ExpandToTic
	lc.Title = "Lin / Lin"
	lc.XRange.Min, lc.XRange.Max = 0, 0
	lc.YRange.Min, lc.YRange.Max = 0, 0
	dumper.Plot(&lc)

	lc.Title = "Lin / Log"
	lc.XRange.Log, lc.YRange.Log = false, true
	lc.XRange.Min, lc.XRange.Max, lc.XRange.TicSetting.Delta = 0, 0, 0
	lc.YRange.Min, lc.YRange.Max, lc.YRange.TicSetting.Delta = 0, 0, 0
	dumper.Plot(&lc)

	lc.Title = "Log / Lin"
	lc.XRange.Log, lc.YRange.Log = true, false
	lc.XRange.Min, lc.XRange.Max, lc.XRange.TicSetting.Delta = 0, 0, 0
	lc.YRange.Min, lc.YRange.Max, lc.YRange.TicSetting.Delta = 0, 0, 0
	dumper.Plot(&lc)

	lc.Title = "Log / Log"
	lc.XRange.Log, lc.YRange.Log = true, true
	lc.XRange.Min, lc.XRange.Max, lc.XRange.TicSetting.Delta = 0, 0, 0
	lc.YRange.Min, lc.YRange.Max, lc.YRange.TicSetting.Delta = 0, 0, 0
	dumper.Plot(&lc)
}
940162
func log(n, b float64) float64 {
	return math.Log(n) / math.Log(b)
}
769300
func (ns *Namespace) Log(a interface{}) (float64, error) {
	af, err := cast.ToFloat64E(a)

	if err != nil {
		return 0, errors.New("Log operator can't be used with non integer or float value")
	}

	return math.Log(af), nil
}
859756
func (s *UpdateBrokerRequest) SetLogs(v *Logs) *UpdateBrokerRequest {
	s.Logs = v
	return s
}