// Copy returns a deep copy of term.
965335
func (term *Term) Copy() *Term {

	if term == nil {
		return nil
	}

	cpy := *term

	switch v := term.Value.(type) {
	case Null, Boolean, Number, String, Var:
		cpy.Value = v
	case Ref:
		cpy.Value = v.Copy()
	case Array:
		cpy.Value = v.Copy()
	case Set:
		cpy.Value = v.Copy()
	case Object:
		cpy.Value = v.Copy()
	case *ArrayComprehension:
		cpy.Value = v.Copy()
	case *ObjectComprehension:
		cpy.Value = v.Copy()
	case *SetComprehension:
		cpy.Value = v.Copy()
	case Call:
		cpy.Value = v.Copy()
	}

	return &cpy
}
349828
func (g *Generator) Copy(n interface{}) error {
	switch v := n.(type) {
	case *ast.TypeSpec:
		return g.CopyType(v)
	case *ast.ValueSpec:
		return g.CopyVal(v)
	}

	return fmt.Errorf("can't copy variable of type: %T", n)
}
326521
func (d *EphemeralDisk) Copy() *EphemeralDisk {
	ld := new(EphemeralDisk)
	*ld = *d
	return ld
}
312446
func (opt Option) Copy(p []byte) Option {
	n := copy(p, opt.Name)
	opt.Name = p[:n]
	opt.Parameters, p = opt.Parameters.Copy(p[n:])
	return opt
}
773270
func (r *ReqLogEntry) Copy() *ReqLogEntry {
	out := *r
	out.log = nil
	return &out
}
189435
func (bA *BitArray) Copy() *BitArray {
	if bA == nil {
		return nil
	}
	bA.mtx.Lock()
	defer bA.mtx.Unlock()
	return bA.copy()
}
647270
func (t *Tags) Copy() *Tags {
	if t == nil {
		return nil
	}
	dst := make(Tags, len(*t))
	copy(dst, *t)
	return &dst
}
507654
func (l *logger) Copy() Logger {
	l2 := &logger{
		level:          l.level,
		output:         l.output,
		fields:         map[string]interface{}{},
		disablePooling: l.disablePooling,
	}
	for k, v := range l.fields {
		l2.fields[k] = v
	}
	return l2
}
530037
func (fs *Filespace) Copy(src, dest string) error {
	return disk.Copy(fs.path+src, fs.path+dest)
}
648596
func Copy(dst, src string) error {
	return FilterTo(dst, src, true, nil)
}
1126743
func (mv *Validator) copy() *Validator {
	return &Validator{
		tagName:         mv.tagName,
		validationFuncs: mv.validationFuncs,
	}
}
1251722
func (g *Group) Copy(dst Code, src Code) *Statement {
	s := Copy(dst, src)
	g.items = append(g.items, s)
	return s
}
77708
func (s StringStringMap) Copy() StringStringMap {
	m := make(StringStringMap)
	for key, value := range s {
		m[key] = value
	}
	return m
}
1304387
func Copy(src reflect.Value) reflect.Value {
	d := make(deepcopy)
	return d.copy(src)
}
632862
func Copy(src interface{}) interface{} {
	if src == nil {
		return nil
	}

	// Make the interface a reflect.Value
	original := reflect.ValueOf(src)

	// Make a copy of the same type as the original.
	cpy := reflect.New(original.Type()).Elem()

	// Recursively copy the original.
	copyRecursive(original, cpy)

	// Return the copy as an interface.
	return cpy.Interface()
}
608592
func Copy(g Iterator) *Mutable {
	switch g := g.(type) {
	case *Mutable:
		return copyMutable(g)
	case *Immutable:
		return copyImmutable(g)
	}
	n := g.Order()
	h := New(n)
	for v := 0; v < n; v++ {
		g.Visit(v, func(w int, c int64) (skip bool) {
			h.AddCost(v, w, c)
			return
		})
	}
	return h
}
829656
func (z *Big) Copy(x *Big) *Big {
	if debug {
		x.validate()
	}
	if z != x {
		sign := x.form & signbit
		z.copyAbs(x)
		z.form |= sign
	}
	return z
}