<commit_before>/// <reference path='../../../third_party/uTransformers/utransformers.d.ts' />
/// <reference path='../../../third_party/aes-js/aes-js.d.ts' />

import arraybuffers = require('../arraybuffers/arraybuffers');
import encryption = require('../fancy-transformers/encryptionShaper');
import logging = require('../logging/logging');
import sequence = require('../fancy-transformers/byteSequenceShaper');

var log :logging.Log = new logging.Log('protean');

export interface ProteanConfig {
  encryption :encryption.EncryptionConfig;

  injection :sequence.SequenceConfig
}

function flatMap<T,E>(input :Array<T>, func :(t :T) => Array<E>) :Array<E> {
  return input.reduce((ys :Array<E>, x :T) :Array<E> => {
    return ys.concat(func(x));
  }, []);
}

// A packet shaper that encrypts the packets with AES CBC.<commit_msg>Renamed variables in flatMap()<commit_after>/// <reference path='../../../third_party/uTransformers/utransformers.d.ts' />
/// <reference path='../../../third_party/aes-js/aes-js.d.ts' />

import arraybuffers = require('../arraybuffers/arraybuffers');
import encryption = require('../fancy-transformers/encryptionShaper');
import logging = require('../logging/logging');
import sequence = require('../fancy-transformers/byteSequenceShaper');

var log :logging.Log = new logging.Log('protean');

export interface ProteanConfig {
  encryption :encryption.EncryptionConfig;

  injection :sequence.SequenceConfig
}

function flatMap<T,E>(input :Array<T>, mappedFunction :(element :T) => Array<E>) :Array<E> {
  return input.reduce((accumulator :Array<E>, item :T) :Array<E> => {
    return accumulator.concat(mappedFunction(item));
  }, []);
}

// A packet shaper that encrypts the packets with AES CBC.
{'fraction_non_alphanumeric': 0.18486424032351242, 'fraction_numerical': 0.0, 'mean_word_length': 4.587096774193548, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '2735607', 'n_tokens_mistral': 550, 'n_tokens_neox': 533, 'n_words': 112}