// RadioFieldFromInstance creates and initializes a radio field based on its name, the reference object instance and field number.
355603
func StaticFieldFromInstance(val reflect.Value, t reflect.Type, fieldNo int, name string) *Field {
	ret := StaticField(name, fmt.Sprintf("%s", val.Field(fieldNo).Interface()))
	return ret
}
154274
func EventToSelectableFields(event *api.Event) fields.Set {
	objectMetaFieldsSet := generic.ObjectMetaFieldsSet(&event.ObjectMeta, true)
	specificFieldsSet := fields.Set{
		"involvedObject.kind":            event.InvolvedObject.Kind,
		"involvedObject.namespace":       event.InvolvedObject.Namespace,
		"involvedObject.name":            event.InvolvedObject.Name,
		"involvedObject.uid":             string(event.InvolvedObject.UID),
		"involvedObject.apiVersion":      event.InvolvedObject.APIVersion,
		"involvedObject.resourceVersion": event.InvolvedObject.ResourceVersion,
		"involvedObject.fieldPath":       event.InvolvedObject.FieldPath,
		"reason":                         event.Reason,
		"source":                         event.Source.Component,
		"type":                           event.Type,
	}
	return generic.MergeFieldsSets(objectMetaFieldsSet, specificFieldsSet)
}
8860
func (scope *Scope) PrimaryFields() (fields []*Field) {
	for _, field := range scope.Fields() {
		if field.IsPrimaryKey {
			fields = append(fields, field)
		}
	}
	return fields
}
1102726
func NewNewDecimalFieldDescriptor(nullable NullableColumn, metadata []byte) (
	fd FieldDescriptor,
	remaining []byte,
	err error) {

	if len(metadata) < 2 {
		return nil, nil, errors.New("Metadata has too few bytes")
	}

	return &newDecimalFieldDescriptor{
		baseFieldDescriptor: baseFieldDescriptor{
			fieldType:  mysql_proto.FieldType_NEWDECIMAL,
			isNullable: nullable,
		},

		precision: uint8(metadata[0]),
		decimals:  uint8(metadata[1]),
	}, metadata[2:], nil
}
360802
func PersistentVolumeToSelectableFields(persistentvolume *api.PersistentVolume) fields.Set {
	objectMetaFieldsSet := generic.ObjectMetaFieldsSet(&persistentvolume.ObjectMeta, false)
	specificFieldsSet := fields.Set{
		// This is a bug, but we need to support it for backward compatibility.
		"name": persistentvolume.Name,
	}
	return generic.MergeFieldsSets(objectMetaFieldsSet, specificFieldsSet)
}
159493
func (b binding) FieldMaskField() string {
	var fieldMaskField *descriptor.Field
	for _, f := range b.Method.RequestType.Fields {
		if f.GetTypeName() == ".google.protobuf.FieldMask" {
			// if there is more than 1 FieldMask for this request, then return none
			if fieldMaskField != nil {
				return ""
			}
			fieldMaskField = f
		}
	}
	if fieldMaskField != nil {
		return generator2.CamelCase(fieldMaskField.GetName())
	}
	return ""
}
212196
func Uint32Field(name string, value uint32) FieldOpt {
	return func(em *eventMetadata, ed *eventData) {
		em.writeField(name, inTypeUint32, outTypeDefault, 0)
		ed.writeUint32(value)
	}
}
612969
func RadioField(name string, choices []InputChoice) *Field {
	ret := FieldWithType(name, formcommon.RADIO)
	ret.choices = []InputChoice{}
	ret.SetChoices(choices)
	return ret
}
907
func (fn *RandomFunction) Field(field string) *RandomFunction {
	fn.field = field
	return fn
}
1281433
func setEmptyFieldsFromActual(requested, actual interface{}, fields ...string) error {
	requestedValue := reflect.ValueOf(requested).Elem()
	actualValue := reflect.ValueOf(actual).Elem()

	if requestedValue.Type() != actualValue.Type() {
		return errors.Errorf("attempted to set fields from different types: %q from %q",
			requestedValue, actualValue)
	}

	for _, field := range fields {
		requestedField := requestedValue.FieldByName(field)
		if !requestedField.IsValid() {
			return errors.Errorf("no such field %q to cleanup", field)
		}
		actualField := actualValue.FieldByName(field)
		if !actualField.IsValid() {
			return errors.Errorf("no such field %q to cleanup", field)
		}

		if reflect.DeepEqual(requestedField.Interface(), reflect.Zero(requestedField.Type()).Interface()) {
			requestedField.Set(actualField)
		}
	}

	return nil
}
914631
func Field(pointerToAField interface{}, rigthOperand ...Expression) (exp Expression) {
	if len(rigthOperand) == 0 {
		return &FieldExpression{pointerToAField, nil}
	}
	return &FieldExpression{pointerToAField, rigthOperand[0]}
}
666823
func RangeField(name string, min, max, step int) *Field {
	ret := FieldWithType(name, formcommon.RANGE)
	ret.SetParam("min", fmt.Sprintf("%d", min))
	ret.SetParam("max", fmt.Sprintf("%d", max))
	ret.SetParam("step", fmt.Sprintf("%d", step))
	return ret
}
1360539
func (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value, valid bool) {
	// replicate FieldByIndex
	for i, x := range si.is {
		if uint8(i) == si.nis {
			break
		}
		if v, valid = baseStructRv(v, update); !valid {
			return
		}
		v = v.Field(int(x))
	}

	return v, true
}
1188587
func (obj *Doc) GetFieldOnTheFlyByName(ctx context.Context, readableName string) (string, error) {
	result := &struct {
		Name string	`json:"qName"`
	} {}
	err := obj.rpc(ctx, "GetFieldOnTheFlyByName", result, readableName)
	return result.Name, err 
}
1241786
func InstanceGroupToSelectableFields(obj *kops.InstanceGroup) fields.Set {
	return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
}
1085903
func legacyBuildFieldSelectorKeyConversionFunc(label, value string) (internalLabel, internalValue string, err error) {
	switch label {
	case "status",
		"podName":
		return label, value, nil
	default:
		return apihelpers.LegacyMetaV1FieldSelectorConversionWithName(label, value)
	}
}
5460
func CheckboxFromInstance(val reflect.Value, t reflect.Type, fieldNo int, name string, options map[string]struct{}) *Field {
	ret := FieldWithType(name, formcommon.CHECKBOX)
	if _, ok := options["checked"]; ok {
		ret.AddTag("checked")
	} else {
		v := val.Field(fieldNo).Bool()
		if v {
			ret.AddTag("checked")
		}
	}
	return ret
}