<commit_before>"use strict";

var TestUtils = require("react-dom/test-utils");

var XPathEvaluator = require("xpath-evaluator");

var ReactElement = require("./react_element");

var compareDocumentPosition = require("./compare_document_position");

function ReactDocument (nativeNode) {
  if (!TestUtils.isElement(nativeNode)) {
    throw new Error("Expected a React element");
  }

  this.elementNode = new ReactElement(nativeNode, this, 0);
}

ReactDocument.prototype.getId = function () {
  return "0";
};

ReactDocument.prototype.isEqual = function (node) {
  return this.getId() === node.getId();
};

ReactDocument.prototype.getNativeNode = function () {
  throw new Error("Accessing the abstract document node is not allowed");
};

ReactDocument.prototype.asString = function () {
  return this.elementNode.asString();
};

ReactDocument.prototype.asNumber = function () {
  return +this.asString();<commit_msg>Use isElement from `react` instead of `react-dom`<commit_after>"use strict";

var React = require("react");

var XPathEvaluator = require("xpath-evaluator");

var ReactElement = require("./react_element");

var compareDocumentPosition = require("./compare_document_position");

function ReactDocument (nativeNode) {
  if (!React.isValidElement(nativeNode)) {
    throw new Error("Expected a React element");
  }

  this.elementNode = new ReactElement(nativeNode, this, 0);
}

ReactDocument.prototype.getId = function () {
  return "0";
};

ReactDocument.prototype.isEqual = function (node) {
  return this.getId() === node.getId();
};

ReactDocument.prototype.getNativeNode = function () {
  throw new Error("Accessing the abstract document node is not allowed");
};

ReactDocument.prototype.asString = function () {
  return this.elementNode.asString();
};

ReactDocument.prototype.asNumber = function () {
  return +this.asString();
{'fraction_non_alphanumeric': 0.13945945945945945, 'fraction_numerical': 0.002162162162162162, 'mean_word_length': 5.360824742268041, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1332507', 'n_tokens_mistral': 530, 'n_tokens_neox': 545, 'n_words': 125}