<commit_before>// Copyright 2014-5 <NAME>. All rights reserved.

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package sorts

import (
	"bytes"
	"sort"
)

const radix = 8
const mask = (1 << radix) - 1

// qSortCutoff is when we bail out to a quicksort. It's changed to 1 for
// certain tests so we can more easily exercise the radix sorting.  This was
// around the break-even point in some sloppy tests.
var qSortCutoff = 1 << 7

const keyPanicMessage = "sort failed: Key and Less aren't consistent with each other"
const keyUint64Help = " (for float data, sortutil Key functions may help resolve this)"
const panicMessage = "sort failed: could be a data race, a radixsort bug, or a subtle bug in the interface implementation"

// maxRadixDepth limits how deeply the radix part of string sorts can
// recurse before we bail to quicksort.  Each recursion uses 2KB stack.
const maxRadixDepth = 32

// task describes a range of data to be sorted and additional
// information the sorter needs: bitshift in a numeric sort, byte offset in
// a string sort, or maximum depth (expressed as -maxDepth-1) for a
// quicksort.
type task struct{ offs, pos, end int }

// ByUint64 sorts data by a uint64 key.<commit_msg>error referred to old package name<commit_after>// Copyright 2014-5 <NAME>. All rights reserved.

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package sorts

import (
	"bytes"
	"sort"
)

const radix = 8
const mask = (1 << radix) - 1

// qSortCutoff is when we bail out to a quicksort. It's changed to 1 for
// certain tests so we can more easily exercise the radix sorting.  This was
// around the break-even point in some sloppy tests.
var qSortCutoff = 1 << 7

const keyPanicMessage = "sort failed: Key and Less aren't consistent with each other"
const keyUint64Help = " (for float data, sortutil Key functions may help resolve this)"
const panicMessage = "sort failed: could be a data race, a bug in package sorts, or a subtle bug in the interface implementation"

// maxRadixDepth limits how deeply the radix part of string sorts can
// recurse before we bail to quicksort.  Each recursion uses 2KB stack.
const maxRadixDepth = 32

// task describes a range of data to be sorted and additional
// information the sorter needs: bitshift in a numeric sort, byte offset in
// a string sort, or maximum depth (expressed as -maxDepth-1) for a
// quicksort.
type task struct{ offs, pos, end int }

// ByUint64 sorts data by a uint64 key.
{'fraction_non_alphanumeric': 0.0702576112412178, 'fraction_numerical': 0.01639344262295082, 'mean_word_length': 3.5767857142857142, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, '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': '6558776', 'n_tokens_mistral': 759, 'n_tokens_neox': 718, 'n_words': 398}