// TopSelf returns the top-level `self` value.
340734
func (m *Mrb) TopSelf() *MrbValue {
	return newValue(m.state, C.mrb_obj_value(unsafe.Pointer(m.state.top_self)))
}
1144403
func (d *Context) ToPrimitive(index int, hint int) {
	C.duk_to_primitive(d.duk_context, C.duk_idx_t(index), C.duk_int_t(hint))
}
657033
func (l *logger) Infof(format string, v ...interface{}) {
	f := extractFields(&v)
	l.send(LevelInfo, 2, fmt.Sprintf(format, v...), f)
}
1177178
func ToPriv(a chronograf.Allowances) string {
	if len(a) == 0 {
		return NoPrivileges
	}
	hasWrite := false
	hasRead := false
	for _, aa := range a {
		if aa == Read {
			hasRead = true
		} else if aa == Write {
			hasWrite = true
		} else if aa == All {
			hasRead, hasWrite = true, true
		}
	}

	if hasWrite && hasRead {
		return All
	} else if hasWrite {
		return Write
	} else if hasRead {
		return Read
	}
	return NoPrivileges
}
842931
func unmarshalTable(cfg *Config, rv reflect.Value, t *ast.Table, toplevelMap bool) error {
	rv = indirect(rv)
	if err, ok := setUnmarshaler(cfg, rv, t); ok {
		return lineError(t.Line, err)
	}
	switch {
	case rv.Kind() == reflect.Struct:
		fc := makeFieldCache(cfg, rv.Type())
		for key, fieldAst := range t.Fields {
			fv, fieldName, err := fc.findField(cfg, rv, key)
			if err != nil {
				return lineError(fieldLineNumber(fieldAst), err)
			}
			if fv.IsValid() {
				if err := unmarshalField(cfg, fv, fieldAst); err != nil {
					return lineErrorField(fieldLineNumber(fieldAst), rv.Type().String()+"."+fieldName, err)
				}
			}
		}
	case rv.Kind() == reflect.Map || isEface(rv):
		m := rv
		if !toplevelMap {
			if rv.Kind() == reflect.Interface {
				m = reflect.ValueOf(make(map[string]interface{}))
			} else {
				m = reflect.MakeMap(rv.Type())
			}
		}
		elemtyp := m.Type().Elem()
		for key, fieldAst := range t.Fields {
			kv, err := unmarshalMapKey(m.Type().Key(), key)
			if err != nil {
				return lineError(fieldLineNumber(fieldAst), err)
			}
			fv := reflect.New(elemtyp).Elem()
			if err := unmarshalField(cfg, fv, fieldAst); err != nil {
				return lineError(fieldLineNumber(fieldAst), err)
			}
			m.SetMapIndex(kv, fv)
		}
		if !toplevelMap {
			rv.Set(m)
		}
	default:
		return lineError(t.Line, &unmarshalTypeError{"table", "struct or map", rv.Type()})
	}
	return nil
}
279575
func (state *TextEditor) tof(start int, dir int, f func(rune) bool) int {
	first := (dir < 0)
	notfirst := !first
	var i int
	for i = start; (i >= 0) && (i < len(state.Buffer)); i += dir {
		c := state.Buffer[i]
		if f(c) {
			if !first {
				i++
			}
			break
		}
		first = notfirst
	}
	if i < 0 {
		i = 0
	}
	return i
}
140963
func TopSort(g Iterator) (order []int, ok bool) {
	order, ok = topsort(g, true)
	return
}
413980
func (k *Kontrol) InitializeSelf() error {
	if len(k.lastPublic) == 0 && len(k.lastPrivate) == 0 {
		return errors.New("Please initialize AddKeyPair() method")
	}

	key, err := k.registerUser(k.Kite.Config.Username, k.lastPublic[0], k.lastPrivate[0])
	if err != nil {
		return err
	}
	return kitekey.Write(key)
}
704032
func (d *Dataset) Top(name string, k int, sortOption *SortOption) *Dataset {
	ret := d.LocalTop(name, k, sortOption)
	if len(d.Shards) > 1 {
		ret = ret.MergeSortedTo(name, 1).LocalLimit(name, k, 0)
	}
	return ret
}
1218577
func ToPascalCase(s string) string {
	if len(s) == 0 {
		return s
	}

	fields := splitToLowerFields(s)
	for i, f := range fields {
		fields[i] = toUpperFirstRune(f)
	}
	return strings.Join(fields, "")
}
819478
func Infof(format string, i ...interface{}) {
	if gLogLevel <= LInfo {
		logMessage("INFO - ", fmt.Sprintf(format, i...))
	}
}
460242
func Infof(format string, v ...interface{}) {
	f := extractFields(&v)
	std.OutputF(LevelInfo, 2, fmt.Sprintf(format, v...), f)
}
741712
func toPropertyDescriptor(rt *_runtime, value Value) (descriptor _property) {
	objectDescriptor := value._object()
	if objectDescriptor == nil {
		panic(rt.panicTypeError())
	}

	{
		descriptor.mode = modeSetMask // Initially nothing is set
		if objectDescriptor.hasProperty("enumerable") {
			if objectDescriptor.get("enumerable").bool() {
				descriptor.enumerateOn()
			} else {
				descriptor.enumerateOff()
			}
		}

		if objectDescriptor.hasProperty("configurable") {
			if objectDescriptor.get("configurable").bool() {
				descriptor.configureOn()
			} else {
				descriptor.configureOff()
			}
		}

		if objectDescriptor.hasProperty("writable") {
			if objectDescriptor.get("writable").bool() {
				descriptor.writeOn()
			} else {
				descriptor.writeOff()
			}
		}
	}

	var getter, setter *_object
	getterSetter := false

	if objectDescriptor.hasProperty("get") {
		value := objectDescriptor.get("get")
		if value.IsDefined() {
			if !value.isCallable() {
				panic(rt.panicTypeError())
			}
			getter = value._object()
			getterSetter = true
		} else {
			getter = &_nilGetSetObject
			getterSetter = true
		}
	}

	if objectDescriptor.hasProperty("set") {
		value := objectDescriptor.get("set")
		if value.IsDefined() {
			if !value.isCallable() {
				panic(rt.panicTypeError())
			}
			setter = value._object()
			getterSetter = true
		} else {
			setter = &_nilGetSetObject
			getterSetter = true
		}
	}

	if getterSetter {
		if descriptor.writeSet() {
			panic(rt.panicTypeError())
		}
		descriptor.value = _propertyGetSet{getter, setter}
	}

	if objectDescriptor.hasProperty("value") {
		if getterSetter {
			panic(rt.panicTypeError())
		}
		descriptor.value = objectDescriptor.get("value")
	}

	return
}
463692
func (s *XormLogger) Infof(format string, v ...interface{}) {
	if s.level <= glog.LvlInfo {
		s.grafanaLog.Info(fmt.Sprintf(format, v...))
	}
}
868234
func Infof(format string, v ...interface{}) {
	if std.Level >= InfoLevel {
		std.Logger.Print(InfoLevel.String() + fmt.Sprintf(format, v...))
	}
}
1100007
func Find(top *Node, expr string) []*Node {
	exp, err := xpath.Compile(expr)
	if err != nil {
		panic(err)
	}
	t := exp.Select(CreateXPathNavigator(top))
	var elems []*Node
	for t.MoveNext() {
		elems = append(elems, getCurrentNode(t))
	}
	return elems
}
599750
func (g *Get) ToProto() proto.Message {
	get := &pb.GetRequest{
		Region: g.regionSpecifier(),
		Get: &pb.Get{
			Row:       g.key,
			Column:    familiesToColumn(g.families),
			TimeRange: &pb.TimeRange{},
		},
	}

	/* added support for limit number of cells per row */
	if g.storeLimit != DefaultMaxResultsPerColumnFamily {
		get.Get.StoreLimit = &g.storeLimit
	}
	if g.storeOffset != 0 {
		get.Get.StoreOffset = &g.storeOffset
	}

	if g.maxVersions != DefaultMaxVersions {
		get.Get.MaxVersions = &g.maxVersions
	}
	if g.fromTimestamp != MinTimestamp {
		get.Get.TimeRange.From = &g.fromTimestamp
	}
	if g.toTimestamp != MaxTimestamp {
		get.Get.TimeRange.To = &g.toTimestamp
	}
	if g.existsOnly {
		get.Get.ExistenceOnly = proto.Bool(true)
	}
	get.Get.Filter = g.filter
	return get
}