// ValueWithShadows returns raw values of key and its shadows if any.
333603
func (k *Key) ValueWithShadows() []string {
	if len(k.shadows) == 0 {
		return []string{k.value}
	}
	vals := make([]string, len(k.shadows)+1)
	vals[0] = k.value
	for i := range k.shadows {
		vals[i+1] = k.shadows[i].value
	}
	return vals
}
194357
func WithIgnoreRevisions(parent context.Context, value ...bool) context.Context {
	v := true
	if len(value) == 1 {
		v = value[0]
	}
	return context.WithValue(contextOrBackground(parent), keyIgnoreRevs, v)
}
595004
func WithValue(parent Context, key interface{}, val interface{}) Context {
	return &valueCtx{parent, key, val}
}
725740
func (k *Key) AddShadow(val string) error {
	if !k.s.f.options.AllowShadows {
		return errors.New("shadow key is not allowed")
	}
	return k.addShadow(val)
}
1046827
func (ctx *Context) WithValue(key, val interface{}) context.Context {
	return context.WithValue(ctx._ctx, key, val)
}
271214
func (d *DynamoDBBackend) LockWith(key, value string) (physical.Lock, error) {
	identity, err := uuid.GenerateUUID()
	if err != nil {
		return nil, err
	}
	return &DynamoDBLock{
		backend:            d,
		key:                pkgPath.Join(pkgPath.Dir(key), DynamoDBLockPrefix+pkgPath.Base(key)),
		value:              value,
		identity:           identity,
		renewInterval:      DynamoDBLockRenewInterval,
		ttl:                DynamoDBLockTTL,
		watchRetryInterval: DynamoDBWatchRetryInterval,
	}, nil
}
1175561
func NewWith(convert StructOptions, value interface{}) Value {
	// quick return if we're passed an existing data.Value
	if val, ok := value.(Value); ok {
		return val
	}

	if value == nil {
		return Null{}
	}

	// see if value implements MarshalValue
	if mar, ok := value.(Marshaler); ok {
		return mar.MarshalValue()
	}

	// drill through pointers and interfaces to the underlying type
	var v = reflect.ValueOf(value)
	for v.Kind() == reflect.Interface || v.Kind() == reflect.Ptr {
		v = v.Elem()
	}
	if !v.IsValid() {
		return Null{}
	}

	if v.Type() == timeType {
		return String(v.Interface().(time.Time).Format(convert.TimeFormat))
	}

	switch v.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return Int(v.Int())
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return Int(v.Uint())
	case reflect.Float32, reflect.Float64:
		return Float(v.Float())
	case reflect.Bool:
		return Bool(v.Bool())
	case reflect.String:
		return String(v.String())
	case reflect.Slice:
		if v.IsNil() {
			return List(nil)
		}
		slice := []Value{}
		for i := 0; i < v.Len(); i++ {
			slice = append(slice, NewWith(convert, v.Index(i).Interface()))
		}
		return List(slice)
	case reflect.Map:
		var m = make(map[string]Value)
		for _, key := range v.MapKeys() {
			if key.Kind() != reflect.String {
				panic("map keys must be strings")
			}
			m[key.String()] = NewWith(convert, v.MapIndex(key).Interface())
		}
		return Map(m)
	case reflect.Struct:
		return convert.Data(v.Interface())
	default:
		panic(fmt.Errorf("unexpected data type: %T (%v)", value, value))
	}
}
592359
func (c *DOM) SetAttributeValueWithParams(v *DOMSetAttributeValueParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.setAttributeValue", Params: v})
}
342464
func (builder *StoreIndexCommandBuilder) WithNVal(nval uint32) *StoreIndexCommandBuilder {
	builder.protobuf.Index.NVal = &nval
	return builder
}
847524
func (r *Runtime) WithValue(key string, value interface{}) *Runtime {
	r.ctx[key] = value

	return r
}
1262280
func monthHasDow(dow, dom, month, year int) bool {
	if !monthHasDom(dom, month, year) {
		return false
	}
	Nday := dom % 7
	var Nmonth int
	switch month {
	case 1:
		Nmonth = 0
	case 2:
		Nmonth = 3
	case 3:
		Nmonth = 3
	case 4:
		Nmonth = 6
	case 5:
		Nmonth = 1
	case 6:
		Nmonth = 4
	case 7:
		Nmonth = 6
	case 8:
		Nmonth = 2
	case 9:
		Nmonth = 5
	case 10:
		Nmonth = 0
	case 11:
		Nmonth = 3
	case 12:
		Nmonth = 5
	}
	var Nyear int
	temp := year % 100
	if temp != 0 {
		Nyear = (temp + (temp / 4)) % 7
	} else {
		Nyear = 0
	}
	Ncent := (3 - ((year / 100) % 4)) * 2
	var Nsj int
	if isLeapYear(year) {
		Nsj = -1
	} else {
		Nsj = 0
	}
	W := (Nday + Nmonth + Nyear + Ncent + Nsj) % 7
	return dow == W
}
343762
func WithValue(parent Context, key interface{}, val interface{}) Context {
	return context.WithValue(parent, key, val)
}
1181597
func WithAlwaysYes(ctx context.Context, bv bool) context.Context {
	return context.WithValue(ctx, ctxKeyAlwaysYes, bv)
}
475299
func (e *merryErr) WithValue(key, value interface{}) Error {
	if e == nil {
		return nil
	}
	return &merryErr{
		err:   e,
		key:   key,
		value: value,
	}
}
578008
func (s *shim) WithFields(fields log.Fields) log.Logger {
	var keyvals []interface{}

	for key, value := range fields {
		keyvals = append(keyvals, key, value)
	}

	return &shim{
		logger: kitlog.With(s.logger, keyvals...),
	}
}
746495
func (ref *Reference) OnceValue() (*DataSnapshot, error) {
	// TODO: find from cached first
	b, err := ref.invokeRequest(http.MethodGet, nil)
	if err != nil {
		return nil, err
	}
	return &DataSnapshot{
		ref: ref,
		raw: b,
	}, nil
}
983095
func (b *Builder) WithDepth(depth uint64) *Builder {
	b.settings.Depth = depth
	return b
}