<commit_before>
import fs from 'fs';
import path from 'path';
import { map } from 'lodash/collection';

import AWS from '../aws-client';
import confirmCommand from './confirmCommand';
import getFixtures from './getFixtures';
const docClient = new AWS.DynamoDB.DocumentClient();

function loadTable(fixture) {
  const tableName = fixture.tableName;
  const jsonFile = path.join(__dirname, '../fixtures/', fixture.jsonFile);
  console.log(`Loading "${tableName}" table data from ${jsonFile}.`);

  const items = JSON.parse(fs.readFileSync(jsonFile), 'utf8');
  items.forEach(function(item) {
      const params = {
          TableName: tableName,
          Item: item
      };

      docClient.put(params, function(err, data) {
         if (err) {
             console.error(`Unable to add item ${JSON.stringify(item)}. Error JSON: ${JSON.stringify(err, null, 2)}`);
         } else {
             console.log(`PutItem succeeded: ${JSON.stringify(item)}`);
         }
      });
  });
}

const fixtures = getFixtures();<commit_msg>Formatting.<commit_after>
import fs from 'fs';
import path from 'path';
import { map } from 'lodash/collection';

import AWS from '../aws-client';
import confirmCommand from './confirmCommand';
import getFixtures from './getFixtures';
const docClient = new AWS.DynamoDB.DocumentClient();

function loadTable(fixture) {
  const tableName = fixture.tableName;
  const jsonFile = path.join(__dirname, '../fixtures/', fixture.jsonFile);
  console.log(`Loading "${tableName}" table data from ${jsonFile}.`);

  const items = JSON.parse(fs.readFileSync(jsonFile), 'utf8');
  items.forEach(function(item) {
    const params = {
      TableName: tableName,
      Item: item
    };

    docClient.put(params, function(err, data) {
      if (err) {
        console.error(`Unable to add item ${JSON.stringify(item)}. Error JSON: ${JSON.stringify(err, null, 2)}`);
      } else {
        console.log(`PutItem succeeded: ${JSON.stringify(item)}`);
      }
    });
  });
}

const fixtures = getFixtures();
{'fraction_non_alphanumeric': 0.15403665180782566, 'fraction_numerical': 0.001981178801386825, 'mean_word_length': 3.4988864142538976, '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': '5503408', 'n_tokens_mistral': 604, 'n_tokens_neox': 599, 'n_words': 155}