// Sets the value v to the enumeration value mapped to the supplied key.
481237
func (e Enum) setValue(v interface{}, key string) error {
	i, err := e.GetValue(key)
	if err != nil {
		return err
	}

	vValue := reflect.ValueOf(v).Elem()
	if !vValue.CanSet() {
		panic(fmt.Errorf("flagenum: Cannot set supplied value, %v", vValue))
	}

	iValue := reflect.ValueOf(i)
	if !vValue.Type().AssignableTo(iValue.Type()) {
		panic(fmt.Errorf("flagenum: Enumeration type (%v) is incompatible with supplied value (%v)",
			vValue.Type(), iValue.Type()))
	}

	vValue.Set(iValue)
	return nil
}
217780
func (re *JSRE) Set(ns string, v interface{}) (err error) {
	re.Do(func(vm *otto.Otto) { err = vm.Set(ns, v) })
	return err
}
591009
func (ev *EnvVars) Set(key, value string) {
	v := os.Getenv(key)
	_, ok := ev.vars[key]
	if !ok {
		ev.vars[key] = v
	}
	if err := os.Setenv(key, value); err != nil {
		msg := fmt.Sprintf("cannot set environment variable %q: %v", key, err)
		ev.assert.Fail(msg)
	}
}
395012
func (s *Secret) SetValue(value []byte, flags uint32) error {
	cvalue := make([]C.uchar, len(value))

	for i := 0; i < len(value); i++ {
		cvalue[i] = C.uchar(value[i])
	}

	var err C.virError
	result := C.virSecretSetValueWrapper(s.ptr, &cvalue[0], C.size_t(len(value)), C.uint(flags), &err)

	if result == -1 {
		return makeError(&err)
	}

	return nil
}
686807
func (vs *ValueMap) Put(k, v Value) {
	if vs == nil {
		panic("put on nil value map")
	}
	vs.hashMap.Put(k, v)
}
1190514
func (s *storeImpl) Set(key string, val interface{}) {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	s.objects[key] = object{contents: val}
}
1286022
func (b *stdBackend) SetVariable(id string, v int64) {
	if b.ssvFilter != nil && !b.ssvFilter(id) {
		return
	}
	b.ssvChangeC <- &stdSSVChange{id, true, v}
}
929046
func (p *EnumParam) Set(s string) error {
	found := false
	for _, v := range p.values {
		if s == v {
			found = true
		}
	}
	if !found {
		return trace.Errorf(
			"value '%v' is not one of the allowed '%v'",
			s, strings.Join(p.values, ","),
		)
	}
	p.value = &s
	return nil
}
680981
func (h *mapHandler) Set(key string, value interface{}, args ...interface{}) error {
	if len(args) != 0 {
		return cfg.ErrArgsNotSupported
	}
	h.values[key] = value
	return nil
}
973553
func (e *Env) SetValue(v interface{}) {
	if reflect.TypeOf(v).Kind() == reflect.Ptr {
		e.Value = reflect.ValueOf(v).Elem()
	} else {
		e.Value = reflect.ValueOf(v)
	}
}
397826
func (s *PutSlotTypeInput) SetEnumerationValues(v []*EnumerationValue) *PutSlotTypeInput {
	s.EnumerationValues = v
	return s
}
434797
func (mmap MarshalMap) Set(key string, val interface{}) {
	mmap.resolvePath(key, mmap, func(p, k reflect.Value, v interface{}) {
		p.SetMapIndex(k, reflect.ValueOf(val))
	})
}
618726
func (v *Var) SetKey(value string) {
	// src := []byte(value)
	// regex := regexp.MustCompile("[0-9A-Za-z]+")
	// chunks := regex.FindAll(src, -1)
	// for i, val := range chunks {
	//
	// }
	v.Key = strings.ToUpper(value)
}
222990
func (u *UUID) setVariant(v byte) {
	switch v {
	case reservedNCS:
		u[8] = (u[8] | reservedNCS) & 0xBF
	case reservedRFC4122:
		u[8] = (u[8] | reservedRFC4122) & 0x7F
	case reservedMicrosoft:
		u[8] = (u[8] | reservedMicrosoft) & 0x3F
	}
}
494538
func (kv *boltKV) enumerate(prefix string) (kvdb.KVPairs, error) {
	if kv.db == nil {
		return nil, kvdb.ErrNotFound
	}

	// XXX FIXME some bug above this cases the prefix to be pre-loaded.
	prefix = strings.TrimPrefix(prefix, kv.domain)
	prefix = kv.domain + prefix

	var kvps = make(kvdb.KVPairs, 0, 100)

	kv.db.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket(pxBucket)
		if bucket == nil {
			logrus.Warnf("Requested bucket not found in internal KVDB: %v",
				pxBucket,
			)
			return kvdb.ErrNotFound
		}

		c := bucket.Cursor()
		for k, v := c.First(); k != nil; k, v = c.Next() {
			if strings.HasPrefix(string(k), prefix) && !strings.Contains(string(k), "/_") {
				var kvp *kvdb.KVPair
				if err := json.Unmarshal(v, &kvp); err != nil {
					logrus.Warnf("Enumerated prefix could not be parsed from KVDB: %v, %v (%v)",
						prefix,
						v,
						err,
					)
					logrus.Fatalf("Could not enumerate internal KVDB: %v: %v",
						v,
						err,
					)
					return err
				}
				kv.normalize(kvp)
				kvps = append(kvps, kvp)
			}
		}
		return nil
	})

	return kvps, nil
}
767845
func (obj *GenericVariable) SetNumValue(ctx context.Context, val Float64) error {
	err := obj.rpc(ctx, "SetNumValue", nil, val)
	return err 
}
4999
func (sv *SyncVal) Set(val interface{}) {
	sv.lock.Lock()
	sv.val = val
	sv.lock.Unlock()
}