<commit_before>const fs = require('fs');
const debug = require('debug')('graph-wrangle:io');
const util = require('util');

function loadGraphFromStdIn() {
  debug(`Reading graph from stdin...`);
  return new Promise(resolve => {
    const chunks = [];
    process.stdin.setEncoding('utf8');

    process.stdin.on('data', chunk => {
      chunks.push(chunk);
    });

    process.stdin.on('end', () => {
      const jsonStr = chunks.join();
      const graph = JSON.parse(jsonStr);<commit_msg>Fix bug where multiple chunks joined with an extra comma<commit_after>const fs = require('fs');
const debug = require('debug')('graph-wrangle:io');
const util = require('util');

function loadGraphFromStdIn() {
  debug(`Reading graph from stdin...`);
  return new Promise(resolve => {
    const chunks = [];
    process.stdin.setEncoding('utf8');

    process.stdin.on('data', chunk => {
      chunks.push(chunk);
    });

    process.stdin.on('end', () => {
      const jsonStr = chunks.join('');
      const graph = JSON.parse(jsonStr);
{'fraction_non_alphanumeric': 0.17652764306498545, 'fraction_numerical': 0.0019398642095053346, 'mean_word_length': 3.7339449541284404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6732803', 'n_tokens_mistral': 316, 'n_tokens_neox': 312, 'n_words': 70}