// Assign sets the values to a setter, "toSetter" contains the setter, so the caller
// can use it for multiple and different structs/functions as well.
322793
func (b *BindObject) Assign(ctx []reflect.Value, toSetter func(reflect.Value)) {
	if b.BindType == Dynamic {
		toSetter(b.ReturnValue(ctx))
		return
	}
	toSetter(b.Value)
}
665166
func Set(c *client.Client, app string, config api.Config) (api.Config, error) {
	body, err := json.Marshal(config)

	if err != nil {
		return api.Config{}, err
	}

	u := fmt.Sprintf("/v1/apps/%s/config/", app)

	resBody, err := c.BasicRequest("POST", u, body)

	if err != nil {
		return api.Config{}, err
	}

	newConfig := api.Config{}
	if err = json.Unmarshal([]byte(resBody), &newConfig); err != nil {
		return api.Config{}, err
	}

	return newConfig, nil
}
854899
func (c *Consumer) Assign(partitions []TopicPartition) (err error) {
	c.appReassigned = true

	cparts := newCPartsFromTopicPartitions(partitions)
	defer C.rd_kafka_topic_partition_list_destroy(cparts)

	e := C.rd_kafka_assign(c.handle.rk, cparts)
	if e != C.RD_KAFKA_RESP_ERR_NO_ERROR {
		return newError(e)
	}

	return nil
}
1235055
func (list *List) Set(idx int, value Value) {
	list.values[idx] = value
}
656147
func set(m map[string]map[string]struct{}, src, dst string) {
	if _, ok := m[src]; !ok {
		m[src] = make(map[string]struct{})
	}
	m[src][dst] = struct{}{}
}
1005936
func (c *Context) Set(name, value string) error {
	c.setFlags = nil
	return c.flagSet.Set(name, value)
}
1084850
func assign(dst, src interface{}) (bool, error) {
	dstrv := indirectAlloc(reflect.ValueOf(dst))
	switch srct := src.(type) {
	case Float:
		if dstrv.Kind() != reflect.Float64 {
			return false, assignError(dstrv, src)
		}
		dstrv.SetFloat(float64(srct))
	case String:
		if dstrv.Kind() != reflect.String {
			return false, assignError(dstrv, src)
		}
		dstrv.SetString(string(srct))
	case Map:
		switch dstrv.Interface().(type) {
		case Map:
			dstrv.Set(reflect.ValueOf(srct))
		default:
			return false, assignError(dstrv, src)
		}
	case Slice:
		switch dstrv.Interface().(type) {
		case Slice:
			dstrv.Set(reflect.ValueOf(srct))
		default:
			return false, assignError(dstrv, src)
		}
	case Array:
		switch dstrv.Interface().(type) {
		case Array:
			dstrv.Set(reflect.ValueOf(srct))
		default:
			switch dstrv.Interface().(type) {
			case Array:
				dstrv.Set(reflect.ValueOf(srct))
			default:
				return false, assignError(dstrv, src)
			}
		}
	case Binary:
		if dstrv.Kind() != reflect.Slice && dstrv.Elem().Kind() != reflect.Uint8 {
			return false, assignError(dstrv, src)
		}
		dstrv.SetBytes([]byte(srct))
	case Undefined:
		// Nothing to do.
	case ObjectId:
		if dstrv.Kind() != reflect.Slice && dstrv.Elem().Kind() != reflect.Uint8 {
			return false, assignError(dstrv, src)
		}
		dstrv.SetBytes([]byte(srct))
	case Bool:
		if dstrv.Kind() != reflect.Bool {
			return false, assignError(dstrv, src)
		}
		dstrv.SetBool(bool(srct))
	case UTCDateTime:
		switch dstrv.Interface().(type) {
		case time.Time:
			// BSON time is milliseconds since unix epoch.
			// Go time is nanoseconds since unix epoch.
			dstrv.Set(reflect.ValueOf(time.Unix(0, int64(srct)*1e3)))
		default:
			if dstrv.Kind() != reflect.Int64 {
				return false, assignError(dstrv, src)
			}
			dstrv.SetInt(int64(srct))
		}
	case Null:
		// Nothing to do.
	case Regexp:
		switch dstrv.Interface().(type) {
		case Regexp:
			dstrv.Set(reflect.ValueOf(srct))
		default:
			return false, assignError(dstrv, src)
		}
	case DBPointer:
			switch dstrv.Interface().(type) {
			case DBPointer:
				dstrv.Set(reflect.ValueOf(srct))
			default:
				return false, assignError(dstrv, src)
			}
	case Javascript:
		if dstrv.Kind() != reflect.String {
			return false, assignError(dstrv, src)
		}
		dstrv.SetString(string(srct))
	case Symbol:
		if dstrv.Kind() != reflect.String {
			return false, assignError(dstrv, src)
		}
		dstrv.SetString(string(srct))
	case JavascriptScope:
		switch dstrv.Interface().(type) {
		case JavascriptScope:
			dstrv.Set(reflect.ValueOf(srct))
		default:
			return false, assignError(dstrv, src)
		}
	case Int32:
		if dstrv.Kind() != reflect.Int32 && dstrv.Kind() != reflect.Int64 {
			return false, assignError(dstrv, src)
		}
		dstrv.SetInt(int64(srct))
	case Timestamp:
		switch dstrv.Interface().(type) {
		case time.Time:
			// BSON time is milliseconds since unix epoch.
			// Go time is nanoseconds since unix epoch.
			dstrv.Set(reflect.ValueOf(time.Unix(0, int64(srct)*1e3)))
		default:
			if dstrv.Kind() != reflect.Int64 {
				return false, assignError(dstrv, src)
			}
			dstrv.SetInt(int64(srct))
		}
	case Int64:
		if dstrv.Kind() != reflect.Int64 {
			return false, assignError(dstrv, src)
		}
		dstrv.SetInt(int64(srct))
	case MinKey:
		// Nothing to do.
	case MaxKey:
		// Nothing to do.
	}
	return true, nil
}
4887
func (c *Controller) Set(key, val interface{}) {
	c.instance.StorageMu.Lock()
	c.instance.Storage[key] = val
	c.instance.StorageMu.Unlock()
}
576607
func (setting Setting) Value() (driver.Value, error) {
	result, err := json.Marshal(setting)
	return string(result), err
}
167577
func (c *Client) Set(key, value string) error {
	key = strings.ToUpper(key)
	if value != "" {
		value = " " + value
	}
	val := "SET" + key + value + "\n"
	if _, err := c.in.Write([]byte(val)); err != nil {
		return err
	}
	line, _, _ := c.out.ReadLine()
	if string(line) != "OK" {
		return errors.Errorf("error: %s", line)
	}
	return nil
}
98888
func assign(gv reflect.Value, sv starlark.Value) error {
	assigner, err := getAssigner(gv.Type(), sv)
	if err != nil {
		return err
	}
	return assigner(gv)
}
121298
func (v Values) Set(key, value string) {
	v[key] = []string{value}
}
392672
func (s *Settings) Set(name string, val interface{}) {
	s.lock.Lock()
	s.data[name] = val
	s.lock.Unlock()
	s.onChange(name)
}
803681
func (c *Client) Assignment() (map[string][]int32, error) {
	request := &clientRequest{
		Key: RequestKeyAssignments,
	}

	assignments := make(map[string][]int32)
	err := c.handleRequest(request, &assignments)
	return assignments, err
}
663751
func (l *Language) Set(key string, value interface{}) {
	if l == nil {
		panic("language not set")
	}
	key = strings.ToLower(key)
	l.settings[key] = value
}
526675
func (l *Level) Set(value string) error {
	v, err := strconv.Atoi(value)
	if err != nil {
		return err
	}
	l.set(Level(v))
	return nil
}
1216208
func assignValue(field, value reflect.Value) {
	switch field.Kind() {
	case reflect.Int, reflect.Int8, reflect.Int16,
		reflect.Int32, reflect.Int64:
		field.SetInt(value.Int())
	case reflect.Uint, reflect.Uint8, reflect.Uint16,
		reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		field.SetUint(value.Uint())
	case reflect.Float32, reflect.Float64:
		field.SetFloat(value.Float())
	case reflect.String:
		field.SetString(value.String())
	case reflect.Bool:
		field.SetBool(value.Bool())
	default:
		field.Set(value)
	}
}