<commit_before>const r = require('rethinkdb');
const uuid = require('uuid/v4');
const hash = require('json-hash');
const config = require('./config');
const db = require('./utilities');

function compareGraphs(graph1, graph2) { // hash should be saved in the graph object
  if (!graph1.hash) {
    graph1.hash = hash.digest(graph1.data);
  }

  if (!graph2.hash) {
    graph2.hash = hash.digest(graph2.data);
  }
  return graph1.hash === graph2.hash;
}

<commit_msg>removed duplication definition of compareGraph() in database/update.js<commit_after>const r = require('rethinkdb');
const uuid = require('uuid/v4');
const hash = require('json-hash');
const config = require('./config');
const db = require('./utilities');

{'fraction_non_alphanumeric': 0.1678224687933426, 'fraction_numerical': 0.016643550624133148, 'mean_word_length': 4.73015873015873, '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': '2736501', 'n_tokens_mistral': 226, 'n_tokens_neox': 224, 'n_words': 58}