// Clone clone an engine
491148
func (engine *Engine) Clone() (*Engine, error) {
	return NewEngine(engine.DriverName(), engine.DataSourceName())
}
811602
func (s *Selection) Clone() *Selection {
	ns := newEmptySelection(s.document)
	ns.Nodes = cloneNodes(s.Nodes)
	return ns
}
118100
func (c *Client) Clone() *Client {
	n := &Client{
		AccessToken:            c.AccessToken,
		AccessTokenSecret:      c.AccessTokenSecret,
		Zone:                   c.Zone,
		TraceMode:              c.TraceMode,
		DefaultTimeoutDuration: c.DefaultTimeoutDuration,
		UserAgent:              c.UserAgent,
		AcceptLanguage:         c.AcceptLanguage,
		RequestTracer:          c.RequestTracer,
		ResponseTracer:         c.ResponseTracer,
		RetryMax:               c.RetryMax,
		RetryInterval:          c.RetryInterval,
		HTTPClient:             c.HTTPClient,
	}
	n.API = newAPI(n)
	return n
}
1277190
func (data Data) Clone() Data {
	r := make(Data)
	for k, v := range data {
		r[k] = v
	}
	return r
}
279141
func (c *Container) Clone() (out *Container) {
	statsHit("Container/Clone")
	switch c.typ {
	case containerArray:
		statsHit("Container/Clone/Array")
		cArray := c.array()
		array := make([]uint16, len(cArray))
		copy(array, cArray)
		out = NewContainerArray(array)
	case containerBitmap:
		statsHit("Container/Clone/Bitmap")
		other := NewContainerBitmap(c.n, nil)
		copy(other.bitmap(), c.bitmap())
		out = other
	case containerRun:
		statsHit("Container/Clone/Run")
		cRuns := c.runs()
		runs := make([]interval16, len(cRuns))
		copy(runs, cRuns)
		out = NewContainerRun(runs)
	}
	// this should probably never happen
	if roaringParanoia {
		if out.n != out.count() {
			panic("cloned container has wrong n")
		}
	}
	return out
}
1213239
func (l *Logger) Clone() *Logger {
	return &Logger{
		Prefix:     l.Prefix,
		Level:      l.Level,
		TimeFormat: l.TimeFormat,
		Printer:    l.Printer,
		handlers:   l.handlers,
		children:   newLoggerMap(),
		mu:         sync.Mutex{},
		once:       sync.Once{},
	}
}
1005554
func Clone(b []byte) []byte {
	if b == nil {
		return nil
	}
	buf := make([]byte, len(b))
	copy(buf, b)
	return buf
}
459834
func (d *DirEntry) Clone() *DirEntry {
	return &DirEntry{
		LockIndex: d.LockIndex,
		Key:       d.Key,
		Flags:     d.Flags,
		Value:     d.Value,
		Session:   d.Session,
		RaftIndex: RaftIndex{
			CreateIndex: d.CreateIndex,
			ModifyIndex: d.ModifyIndex,
		},
	}
}
1145551
func (cl *CommandLine) Clone() *CommandLine {
	return &CommandLine{
		Target: cl.Target,
		Flags:  append([]CommandLineFlag(nil), cl.Flags...),
		Args:   append([]string(nil), cl.Args...),
	}
}
404235
func (r *PURuntime) Clone() *PURuntime {
	r.Lock()
	defer r.Unlock()

	return NewPURuntime(r.name, r.pid, r.nsPath, r.tags.Copy(), r.ips.Copy(), r.puType, r.options)
}
658451
func (v *Values) Clone() *Values {
	v.lock.RLock()
	defer v.lock.RUnlock()

	return newValues(v.root)
}
862211
func (c *CheckState) Clone() *CheckState {
	c2 := new(CheckState)
	*c2 = *c
	return c2
}
1203727
func (e Env) Clone() Env {
	clone := e
	clone.env = nil

	if len(e.env) > 0 {
		clone.env = make(map[string]string, len(e.env))
		for k, v := range e.env {
			clone.env[k] = v
		}
	}
	return clone
}
1118911
func (t textMapReaderWriter) Clone() textMapReaderWriter {
	clone := textMapReaderWriter(map[string]string{})
	t.CloneTo(clone)
	return clone
}
624789
func Clone(from, to string, opts CloneRepoOptions) (err error) {
	toDir := path.Dir(to)
	if err = os.MkdirAll(toDir, os.ModePerm); err != nil {
		return err
	}

	cmd := NewCommand("clone")
	if opts.Mirror {
		cmd.AddArguments("--mirror")
	}
	if opts.Bare {
		cmd.AddArguments("--bare")
	}
	if opts.Quiet {
		cmd.AddArguments("--quiet")
	}
	if len(opts.Branch) > 0 {
		cmd.AddArguments("-b", opts.Branch)
	}
	cmd.AddArguments(from, to)

	if opts.Timeout <= 0 {
		opts.Timeout = -1
	}
	_, err = cmd.RunTimeout(opts.Timeout)
	return err
}
588697
func (l loader) Clone(ctx context.Context, repo, path string) (backend.RCS, error) {
	return Clone(ctx, repo, path)
}
1065192
func (s CPUSet) Clone() CPUSet {
	b := NewBuilder()
	for elem := range s.elems {
		b.Add(elem)
	}
	return b.Result()
}