<commit_before>import Check from "./Check.js";
import defined from "./defined.js";
import DeveloperError from "./DeveloperError.js";

/**
 * Morton Order (aka Z-Order Curve) helper functions.
 * @see {@link https://en.wikipedia.org/wiki/Z-order_curve}
 * @see {@link http://graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN}
 *
 * @namespace MortonOrder
 */
var MortonOrder = {};

/**
 * @private
 * @param {Number} v
 */
function insertSpacingBetweenBits(v) {
  v = (v | (v << 8)) & 0x00ff00ff;
  v = (v | (v << 4)) & 0x0f0f0f0f;
  v = (v | (v << 2)) & 0x33333333;
  v = (v | (v << 1)) & 0x55555555;
  return v;
}

/**
 * @private
 * @param {Number} v
 */
function removeSpacingBetweenBits(v) {
  v = v & 0x55555555;
  v = (v | (v >> 1)) & 0x33333333;
  v = (v | (v >> 2)) & 0x0f0f0f0f;
  v = (v | (v >> 4)) & 0x00ff00ff;<commit_msg>added descriptions for inserSpacingBetweenBits and removeSpacingBetweenBits<commit_after>import Check from "./Check.js";
import defined from "./defined.js";
import DeveloperError from "./DeveloperError.js";

/**
 * Morton Order (aka Z-Order Curve) helper functions.
 * @see {@link https://en.wikipedia.org/wiki/Z-order_curve}
 *
 * @namespace MortonOrder
 */
var MortonOrder = {};

/**
 * Inserts 0 between the bits in a number. This is the opposite of removeSpacingBetweenBits.
 * For example:
 * input: 6
 * input (binary): 110
 * output (binary): 10100
 *                   ^ ^  (added)
 * output: 20
 *
 * @private
 * @param {Number} v A 16-bit unsigned integer
 * @returns {Number} A 32-bit unsigned integer with 0 inserted between input bits
 * @see {@link http://graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN}
 */
function insertSpacingBetweenBits(v) {
  v = (v | (v << 8)) & 0x00ff00ff;
  v = (v | (v << 4)) & 0x0f0f0f0f;
  v = (v | (v << 2)) & 0x33333333;
  v = (v | (v << 1)) & 0x55555555;
  return v;
}

/**
 * Removes every other bit in a number. This is the opposite of insertSpacingBetweenBits.
 * For example:
 * input: 20
 * input (binary): 10100
 *                  ^ ^  (removed)
 * output (binary): 110
 * output: 6
 *
 * @private
 * @param {Number} v A 32-bit unsigned integer
 * @returns {Number} A 16-bit unsigned integer with every other input bit removed
 * @see {@link http://graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN}
 */
function removeSpacingBetweenBits(v) {
  v = v & 0x55555555;
  v = (v | (v >> 1)) & 0x33333333;
  v = (v | (v >> 2)) & 0x0f0f0f0f;
  v = (v | (v >> 4)) & 0x00ff00ff;
{'fraction_non_alphanumeric': 0.16532582461786002, 'fraction_numerical': 0.06355591311343524, 'mean_word_length': 3.3177083333333335, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7526425', 'n_tokens_mistral': 1038, 'n_tokens_neox': 894, 'n_words': 254}