<commit_before>'use strict';

import {times, each, contains, pluck, compact, uniq} from 'lodash';
import test from 'tape';
import picker from '../lib/picker';
import {participants} from 'getconfig';

const ITERATIONS = 2500;

times(ITERATIONS).forEach((n) => {
  test(`Iteration ${n}`, (t) => {
    const picked = picker(participants);
    const names = compact(pluck(picked, 'name'));
    const recipients = compact(pluck(picked, 'recipient'));

    t.ok(names.length, 'Names has items');
    t.ok(recipients.length, 'Recipients has items');
    t.equal(names.length, uniq(names).length, 'Names are unique');
    t.equal(recipients.length, uniq(recipients).length, 'Recipients are unique');
    t.equal(names.length, recipients.length, 'Names and recipients are equal lengths');

    each(picked, (participant) => {
      t.ok(participant.recipient, 'Recipient exists');
      t.ok(participant.name, 'Name exists');
      t.ok(participant.skip, 'Skip exists');

      t.equal(typeof participant.recipient, 'string', 'Recipient is a string');
      t.equal(typeof participant.name, 'string', 'Name is a stirng');
      t.ok(Array.isArray(participant.skip), 'Skip is an array');

      t.notOk(participant.recipient === participant.name, 'Recipient is not the participant');
      t.notOk(contains(participant.skip, participant.recipient), 'Recipient is not in skip');
    });

    t.end();
  });
});<commit_msg>implicit<commit_after>'use strict';

import {times, each, contains, pluck, compact, uniq} from 'lodash';
import test from 'tape';
import picker from '../lib/picker';
import {participants} from 'getconfig';

const ITERATIONS = 2500;

times(ITERATIONS).forEach((n) => test(`Iteration ${n}`, (t) => {
  const picked = picker(participants);
  const names = compact(pluck(picked, 'name'));
  const recipients = compact(pluck(picked, 'recipient'));

  t.ok(names.length, 'Names has items');
  t.ok(recipients.length, 'Recipients has items');
  t.equal(names.length, uniq(names).length, 'Names are unique');
  t.equal(recipients.length, uniq(recipients).length, 'Recipients are unique');
  t.equal(names.length, recipients.length, 'Names and recipients are equal lengths');

  each(picked, (participant) => {
    t.ok(participant.recipient, 'Recipient exists');
    t.ok(participant.name, 'Name exists');
    t.ok(participant.skip, 'Skip exists');

    t.equal(typeof participant.recipient, 'string', 'Recipient is a string');
    t.equal(typeof participant.name, 'string', 'Name is a stirng');
    t.ok(Array.isArray(participant.skip), 'Skip is an array');

    t.notOk(participant.recipient === participant.name, 'Recipient is not the participant');
    t.notOk(contains(participant.skip, participant.recipient), 'Recipient is not in skip');
  });

  t.end();
}));
{'fraction_non_alphanumeric': 0.1628158844765343, 'fraction_numerical': 0.002888086642599278, 'mean_word_length': 4.643584521384929, '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': '5646752', 'n_tokens_mistral': 943, 'n_tokens_neox': 868, 'n_words': 224}