<commit_before>_ = require "underscore"


module.exports = DeepEquality = {}


# Terminology: A "part" of a JS value is an object or array accessible from the
# value through recursive property access (including array indexing). If we
# like, we can also include prototype access as part of our recursive process,
# though its best to ignore the boring prototype Object.prototype.


# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
DeepEquality.cyclicDeepEqual = (a, b, opts) ->
  # PLAN:
  # Recursively check that each piece of a matches a corresponding piece of b.
  # checkPartsEqual should do real work for each part aPart of a only once. This
  # is possible with the following strategy:
  #  * The first time checkPartsEqual is called on aPart, it checks that bPart
  #    is a valid, unclaimed part of b, and then records the association between
  #    aPart and bPart in an array called aPartToBPart. (This all happens before
  #    any recursive calls.)
  #  * If checkPartsEqual is called on aPart a second time, this is the result
  #    of either a cyclic reference during the checking of aPart, or the
  #    checking of some unrelated part of a. In either case, it suffices to<commit_msg>documentation fixes<commit_after>_ = require "underscore"


module.exports = DeepEquality = {}


# Terminology: A "part" of a JS value is an object or array accessible from the
# value through recursive property access (including array indexing). If we
# like, we can also include prototype access as part of our recursive process,
# though its best to ignore the boring prototype Object.prototype.


# cyclicDeepEqual compares two Javascript values. It is comfortable with values
# which have cyclic references between their parts. In this case, it will ensure
# that the two values have isomorphic reference graphs.
#   Opts:
#     checkPrototypes (default: true) -- whether equality of prototypes should
#       be included in the checking process
#     log (default: false) -- whether to log debugging info
DeepEquality.cyclicDeepEqual = (a, b, opts) ->
  # PLAN:
  # Recursively check that each piece of a matches a corresponding piece of b.
  # checkPartsEqual should do real work for each part aPart of a only once. This
  # is possible with the following strategy:
  #  * The first time checkPartsEqual is called on aPart, it checks that bPart
  #    is a valid, unclaimed part of b, and then records the association between
  #    aPart and bPart in an array called aPartToBPart. checkPartsEqual can then
  #    go on to check that aPart and bPart are in fact equal, largely via
  #    recursive calls.
  #  * If checkPartsEqual is called on aPart a second time, this is the result
  #    of either a cyclic reference during the checking of aPart, or the
  #    checking of some unrelated part of a. In either case, it suffices to
{'fraction_non_alphanumeric': 0.05016611295681063, 'fraction_numerical': 0.0, 'mean_word_length': 3.7417322834645668, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3839547', 'n_tokens_mistral': 799, 'n_tokens_neox': 758, 'n_words': 433}