<commit_before>package numgo

import (
	"encoding/json"
	"fmt"
	"math"
	"math/rand"
	"runtime"
	"strings"
)

// Array64 is an n-dimensional array of float64 data
type Array64 struct {
	shape        []int
	strides      []int
	offset       []int
	data         []float64
	err          error
	debug, stack string
}

// NewArray64 creates an Array64 object with dimensions given in order from outer-most to inner-most
// Passing a slice with no shape data will wrap the slice as a 1-D array.
// All values will default to zero.  Passing nil as the data parameter creates an empty array.
func NewArray64(data []float64, shape ...int) (a *Array64) {
	if len(shape) == 0 {
		switch {
		case data != nil:
			return &Array64{
				shape:   []int{len(data)},
				strides: []int{len(data), 1},
				data:    data,
				err:     nil,
				debug:   "",
				stack:   "",
			}
		default:
			return &Array64{
				shape:   []int{0},
				strides: []int{0, 0},
				data:    []float64{},
				err:     nil,
				debug:   "",
				stack:   "",
			}
		}
	}

	var sz int = 1
	sh := make([]int, len(shape))
	for i, v := range shape {
		if v < 0 {
			a = &Array64{err: NegativeAxis}
			if debug {
				a.debug = fmt.Sprintf("Negative axis length received by Create: %v", shape)
				a.stack = string(stackBuf[:runtime.Stack(stackBuf, false)])
			}
			return
		}
		sz *= v
		sh[i] = v
	}

	a = &Array64{
		shape:   sh,
		strides: make([]int, len(shape)+1),
		data:    make([]float64, sz),
		err:     nil,
		debug:   "",
		stack:   "",
	}<commit_msg>for loop to copy call<commit_after>package numgo

import (
	"encoding/json"
	"fmt"
	"math"
	"math/rand"
	"runtime"
	"strings"
)

// Array64 is an n-dimensional array of float64 data
type Array64 struct {
	shape        []int
	strides      []int
	data         []float64
	err          error
	debug, stack string
}

// NewArray64 creates an Array64 object with dimensions given in order from outer-most to inner-most
// Passing a slice with no shape data will wrap the slice as a 1-D array.
// All values will default to zero.  Passing nil as the data parameter creates an empty array.
func NewArray64(data []float64, shape ...int) (a *Array64) {
	if len(shape) == 0 {
		switch {
		case data != nil:
			return &Array64{
				shape:   []int{len(data)},
				strides: []int{len(data), 1},
				data:    data,
				err:     nil,
				debug:   "",
				stack:   "",
			}
		default:
			return &Array64{
				shape:   []int{0},
				strides: []int{0, 0},
				data:    []float64{},
				err:     nil,
				debug:   "",
				stack:   "",
			}
		}
	}

	var sz = 1
	sh := make([]int, len(shape))
	for _, v := range shape {
		if v < 0 {
			a = &Array64{err: NegativeAxis}
			if debug {
				a.debug = fmt.Sprintf("Negative axis length received by Create: %v", shape)
				a.stack = string(stackBuf[:runtime.Stack(stackBuf, false)])
			}
			return
		}
		sz *= v
	}
	copy(sh, shape)

	a = &Array64{
		shape:   sh,
		strides: make([]int, len(shape)+1),
		data:    make([]float64, sz),
		err:     nil,
		debug:   "",
		stack:   "",
	}
{'fraction_non_alphanumeric': 0.14328358208955225, 'fraction_numerical': 0.025870646766169153, 'mean_word_length': 2.446857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4770246', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1085, 'n_words': 340}