// Clone returns a copy of the given image.
489881
func Clone(img image.Image) *image.NRGBA {
	src := newScanner(img)
	dst := image.NewNRGBA(image.Rect(0, 0, src.w, src.h))
	size := src.w * 4
	parallel(0, src.h, func(ys <-chan int) {
		for y := range ys {
			i := y * dst.Stride
			src.scan(0, y, src.w, y+1, dst.Pix[i:i+size])
		}
	})
	return dst
}
193661
func (s *ServiceState) Clone() *ServiceState {
	s2 := new(ServiceState)
	*s2 = *s
	return s2
}
877120
func (d *D) Clone() *D {
	return &D{
		Values:   d.Values.Clone(),
		hijacker: d.hijacker,
		goodFunc: d.goodFunc,
	}
}
870108
func (buf *Float32Buffer) Clone() Buffer {
	if buf == nil {
		return nil
	}
	newB := &Float32Buffer{}
	newB.Data = make([]float32, len(buf.Data))
	copy(newB.Data, buf.Data)
	newB.Format = &Format{
		NumChannels: buf.Format.NumChannels,
		SampleRate:  buf.Format.SampleRate,
	}
	return newB
}
785561
func (b *PCMBuffer) Clone() *PCMBuffer {
	if b == nil {
		return nil
	}
	newB := &PCMBuffer{DataType: b.DataType}
	switch b.DataType {
	case Integer:
		newB.Ints = make([]int, len(b.Ints))
		copy(newB.Ints, b.Ints)
	case Float:
		newB.Floats = make([]float64, len(b.Floats))
		copy(newB.Floats, b.Floats)
	case Byte:
		newB.Bytes = make([]byte, len(b.Bytes))
		copy(newB.Bytes, b.Bytes)
	}
	newB.Format = &Format{
		NumChannels: b.Format.NumChannels,
		SampleRate:  b.Format.SampleRate,
		BitDepth:    b.Format.BitDepth,
		Endianness:  b.Format.Endianness,
	}
	return newB
}
1262380
func (h *Hero) Clone() *Hero {
	child := New()
	child.values = h.values.Clone()
	return child
}
1005554
func Clone(b []byte) []byte {
	if b == nil {
		return nil
	}
	buf := make([]byte, len(b))
	copy(buf, b)
	return buf
}
101435
func (w *responseWriter) Clone() ResponseWriter {
	wc := &responseWriter{}
	wc.ResponseWriter = w.ResponseWriter
	wc.statusCode = w.statusCode
	wc.beforeFlush = w.beforeFlush
	wc.written = w.written
	return wc
}
169724
func (s *Style) Clone() *Style {
	return &Style{Name: s.Name, Value: s.Value}
}
102934
func (t *Template) Clone() *Template {
	hm, _ := NewHelperMap()
	hm.AddMany(t.Helpers.Helpers())
	t2 := &Template{
		Helpers: hm,
		Input:   t.Input,
		program: t.program,
	}
	return t2
}
11387
func (ds *DiskSource) Clone() Source {
	dsc := &DiskSource{
		BasePath:       ds.BasePath,
		BlockAddresses: ds.BlockAddresses,

		Container: ds.Container,
	}

	if ds.Decompressor != nil {
		dsc.Decompressor = ds.Decompressor.Clone()
	}

	return dsc
}
1158455
func (*TemplateProvider) Clone(d *deps.Deps) error {

	t := d.Tmpl.(*templateHandler)
	clone := t.clone(d)

	d.Tmpl = clone

	return clone.MarkReady()

}
1277190
func (data Data) Clone() Data {
	r := make(Data)
	for k, v := range data {
		r[k] = v
	}
	return r
}
862211
func (c *CheckState) Clone() *CheckState {
	c2 := new(CheckState)
	*c2 = *c
	return c2
}
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
}
906964
func (c *Coordinate) Clone() *Coordinate {
	vec := make([]float64, len(c.Vec))
	copy(vec, c.Vec)
	return &Coordinate{
		Vec:        vec,
		Error:      c.Error,
		Adjustment: c.Adjustment,
		Height:     c.Height,
	}
}
996220
func (n *Node) Clone() *Node {
	var c Node
	c.Copy(n)
	return &c
}