// convert a to b safely.
501847
func convert(a, b reflect.Value) (_ reflect.Value, err error) {
	defer func() {
		if r := recover(); r != nil {
			err = fmt.Errorf("%v", r)
		}
	}()
	return a.Convert(b.Type()), nil
}
1094612
func (files FilesByDate) Swap(a, b int) {
	files[a], files[b] = files[b], files[a]
}
626128
func (p *stepConverter) convertSubsteps(c context.Context, bbSteps *[]*pb.Step, annSubsteps []*annotpb.Step_Substep, stepPrefix string) ([]*pb.Step, error) {
	bbSubsteps := make([]*pb.Step, 0, len(annSubsteps))
	for _, annSubstep := range annSubsteps {
		annStep := annSubstep.GetStep()
		if annStep == nil {
			return nil, errors.Reason("unexpected non-Step substep %v", annSubstep).Err()
		}

		bbSubstep, err := p.convertSteps(c, bbSteps, annStep, stepPrefix)
		if err != nil {
			return nil, err
		}

		bbSubsteps = append(bbSubsteps, bbSubstep)
	}

	return bbSubsteps, nil
}
147886
func Intersect(a, b [][]byte) [][]byte {
	n := len(b)
	if len(a) > len(b) {
		n = len(a)
	}
	other := make([][]byte, 0, n)

	for len(a) > 0 && len(b) > 0 {
		if cmp := bytes.Compare(a[0], b[0]); cmp == 0 {
			other, a, b = append(other, a[0]), a[1:], b[1:]
		} else if cmp == -1 {
			a = a[1:]
		} else {
			b = b[1:]
		}
	}
	return other
}
671630
func (orig *FooJSON) Convert() (*Foo, error) {
	ret := &Foo{}

	b := NewFooJSONBuilder().AddAll()
	for _, info := range b._properties {
		if err := info.Decoder(orig, ret); err != nil {
			return nil, err
		}
	}

	return ret, nil
}
1208029
func (orig *SampleFJSON) Convert() (*SampleF, error) {
	ret := &SampleF{}

	b := NewSampleFJSONBuilder().AddAll()
	for _, info := range b._properties {
		if err := info.Decoder(orig, ret); err != nil {
			return nil, err
		}
	}

	return ret, nil
}
951504
func Add(a, b []float32) {
	b = b[:len(a)]
	for i, v := range a {
		a[i] = v + b[i]
	}
}
797384
func Convert_v1_ImageBlobReferences_To_image_ImageBlobReferences(in *v1.ImageBlobReferences, out *image.ImageBlobReferences, s conversion.Scope) error {
	return autoConvert_v1_ImageBlobReferences_To_image_ImageBlobReferences(in, out, s)
}
961841
func Convert(spec *hclspec.Spec) (hcldec.Spec, hcl.Diagnostics) {
	if spec == nil {
		return nil, hcl.Diagnostics([]*hcl.Diagnostic{nilSpecDiagnostic})
	}

	return decodeSpecBlock(spec, "")
}
287410
func (converter ListConverter) Convert(value interface{}, item AttributeAccessor) (interface{}, error) {
	if value == nil {
		return make([]string, 0), nil
	}
	result := make([]string, 1)
	result[0] = value.(string)
	return result, nil
}
762178
func concat(a, b []byte) []byte {
	c := make([]byte, len(a)+len(b))
	copy(c, a)
	copy(c[len(a):], b)
	return c
}
593625
func areEqual(a, b interface{}) bool {
	if isNil(a) || isNil(b) {
		if isNil(a) && !isNil(b) {
			return false
		}
		if !isNil(a) && isNil(b) {
			return false
		}
		return true
	}
	if reflect.DeepEqual(a, b) {
		return true
	}
	aValue := reflect.ValueOf(a)
	bValue := reflect.ValueOf(b)
	return aValue == bValue
}
1177179
func (c *safeConverterWrapper) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) {
	return c.unsafe.ConvertToVersion(in.DeepCopyObject(), target)
}
343560
func safeAdd(a, b int64) (int64, bool) {
	if b > 0 && a > math.MaxInt64-b {
		return -1, true
	} else if b < 0 && a < math.MinInt64-b {
		return -1, true
	}
	return a + b, false
}
56171
func (p Path) Convert() string {
	if len(p) == 0 {
		return ""
	}
	var op []string
	for _, id := range p {
		op = append(op, id.String())
	}
	str := strings.Join(op, SepInDatabase)
	return strings.Replace(str, "-", "_", -1)
}
288660
func (is *I) Equal(a, b interface{}) {
	if !areEqual(a, b) {
		if isNil(a) || isNil(b) {
			aLabel := is.valWithType(a)
			bLabel := is.valWithType(b)
			if isNil(a) {
				aLabel = "<nil>"
			}
			if isNil(b) {
				bLabel = "<nil>"
			}
			is.logf("%s != %s", aLabel, bLabel)
			return
		}
		if reflect.ValueOf(a).Type() == reflect.ValueOf(b).Type() {
			is.logf("%v != %v", a, b)
			return
		}
		is.logf("%s != %s", is.valWithType(a), is.valWithType(b))
	}
}
126485
func (ns *Namespace) Mod(a, b interface{}) (int64, error) {
	ai, erra := cast.ToInt64E(a)
	bi, errb := cast.ToInt64E(b)

	if erra != nil || errb != nil {
		return 0, errors.New("modulo operator can't be used with non integer value")
	}

	if bi == 0 {
		return 0, errors.New("the number can't be divided by zero at modulo operation")
	}

	return ai % bi, nil
}