// Copy preserves the original params value (key value pair)
// but stores the data in a different reference address
977019
func (originalParams Params) Copy() Params {
	if originalParams == nil {
		return nil
	}

	params := Params{}
	for key, value := range originalParams {
		params[key] = value
	}

	return params
}
703868
func (c *SyncCollector) Copy(m map[string]interface{}) {
	for v, k := range m {
		c.Set(v, k)
	}
}
322858
func (s Storage) Copy() Storage {
	cpy := make(Storage)
	for key, value := range s {
		cpy[key] = value
	}

	return cpy
}
902011
func (p *DataFrame) Copy() *DataFrame {
	result := NewDataFrame()

	for k, v := range p.data {
		result.data[k] = v
	}

	result.parent = p

	return result
}
184258
func (c Config) Copy() (m Map) {
	m = make(Map)
	for k, v := range c.root {
		m[k] = v
	}
	return
}
500158
func (co CallOptions) Copy() CallOptions {
	if len(co) == 0 {
		return nil
	}
	x := make(CallOptions, len(co))
	copy(x, co)
	return x
}
639666
func (r *Store) Copy(ctx context.Context, from, to string) error {
	return r.move(ctx, from, to, false)
}
74277
func Copy(src PackedIntsReader, srcPos int, dest Mutable, destPos, length, mem int) {
	assert(srcPos+length <= int(src.Size()))
	assert(destPos+length <= int(dest.Size()))
	capacity := int(uint(mem) >> 3)
	if capacity == 0 {
		panic("niy")
	} else if length > 0 {
		// use bulk operations
		if length < capacity {
			capacity = length
		}
		buf := make([]int64, capacity)
		copyWith(src, srcPos, dest, destPos, length, buf)
	}
}
538496
func (ac *ArrayComprehension) Copy() *ArrayComprehension {
	cpy := *ac
	cpy.Body = ac.Body.Copy()
	cpy.Term = ac.Term.Copy()
	return &cpy
}
491313
func (md *MDServerDisk) copy(config mdServerLocalConfig) mdServerLocal {
	// NOTE: observers and sessionHeads are copied shallowly on
	// purpose, so that the MD server that gets a Put will notify all
	// observers correctly no matter where they got on the list.
	log := config.MakeLogger("")
	return &MDServerDisk{config, log, md.mdServerDiskShared}
}
1198143
func (q *Query) Copy() *Query {
	var modelValues map[string]*queryParamsAppender
	if len(q.modelValues) > 0 {
		modelValues = make(map[string]*queryParamsAppender, len(q.modelValues))
		for k, v := range q.modelValues {
			modelValues[k] = v
		}
	}

	copy := &Query{
		ctx:       q.ctx,
		db:        q.db,
		stickyErr: q.stickyErr,

		model:         q.model,
		implicitModel: q.implicitModel,
		deleted:       q.deleted,

		with:        q.with[:len(q.with):len(q.with)],
		tables:      q.tables[:len(q.tables):len(q.tables)],
		columns:     q.columns[:len(q.columns):len(q.columns)],
		set:         q.set[:len(q.set):len(q.set)],
		modelValues: modelValues,
		where:       q.where[:len(q.where):len(q.where)],
		updWhere:    q.updWhere[:len(q.updWhere):len(q.updWhere)],
		joins:       q.joins[:len(q.joins):len(q.joins)],
		group:       q.group[:len(q.group):len(q.group)],
		having:      q.having[:len(q.having):len(q.having)],
		order:       q.order[:len(q.order):len(q.order)],
		onConflict:  q.onConflict,
		returning:   q.returning[:len(q.returning):len(q.returning)],
		limit:       q.limit,
		offset:      q.offset,
		selFor:      q.selFor,
	}

	return copy
}
81454
func (a Args) Copy() Args {
	cpy := Args{}
	for _, t := range a {
		cpy = append(cpy, t.Copy())
	}
	return cpy
}
1171390
func (c *Client) copy(ctx context.Context, version string) error {
	backupDir := path.Join(path.Dir(c.Path), "backup")
	if _, err := os.Stat(backupDir); os.IsNotExist(err) {
		if err = os.Mkdir(backupDir, 0700); err != nil {
			return err
		}
	} else if err != nil {
		return err
	}

	fromFile, err := os.Open(c.Path)
	if err != nil {
		return err
	}
	defer fromFile.Close()

	toName := fmt.Sprintf("%s.%s", path.Base(c.Path), version)
	toPath := path.Join(backupDir, toName)
	toFile, err := os.OpenFile(toPath, os.O_RDWR|os.O_CREATE, 0600)
	if err != nil {
		return err
	}
	defer toFile.Close()

	_, err = io.Copy(toFile, fromFile)
	if err != nil {
		return err
	}

	c.logger.Info("Successfully created ", toPath)

	return nil
}
92535
func (sm *StateMachine) copy() *StateMachine {
	var r StateMachine
	r = *sm
	r.buf = bytes.NewBuffer(sm.buf.Bytes())
	return &r
}
575385
func (body Body) Copy() Body {
	cpy := make(Body, len(body))
	for i := range body {
		cpy[i] = body[i].Copy()
	}
	return cpy
}
608317
func (c *VaultConfig) Copy() *VaultConfig {
	if c == nil {
		return nil
	}

	nc := new(VaultConfig)
	*nc = *c
	return nc
}
1304387
func Copy(src reflect.Value) reflect.Value {
	d := make(deepcopy)
	return d.copy(src)
}