<commit_before>require('source-map-support').install();

import { Q, config, Azk, pp, _ } from 'azk';
import Utils from 'azk/utils';

var chai = require('chai');
var tmp  = require('tmp');
var path = require('path');

// Chai extensions
require("mocha-as-promised")();
chai.use(require('chai-as-promised'));
chai.use(require('chai-things'));

var MemoryStream  = require('memorystream');

var Helpers = {
  pp: pp,
  capture_io: capture_io,
  tmp_dir: Q.denodeify(tmp.dir),
  expect : chai.expect,

  fixture_path(fixture) {
    return Utils.resolve(
      '.', 'spec', 'fixtures', fixture
    );
  },

  makeMemoryStream(...args) {
    return new MemoryStream(...args);
  }
}

// Helpers
require('spec/spec_helpers/mock_outputs').extend(Helpers);

export default Helpers;<commit_msg>Adding task before all test, now removing all containers.<commit_after>require('source-map-support').install();

import { Q, config, Azk, pp, _ } from 'azk';
import docker from 'azk/docker';
import Utils from 'azk/utils';

var chai = require('chai');
var tmp  = require('tmp');
var path = require('path');

// Chai extensions
require("mocha-as-promised")();
chai.use(require('chai-as-promised'));
chai.use(require('chai-things'));

var MemoryStream  = require('memorystream');

var Helpers = {
  pp: pp,
  capture_io: capture_io,
  tmp_dir: Q.denodeify(tmp.dir),
  expect : chai.expect,

  fixture_path(fixture) {
    return Utils.resolve(
      '.', 'spec', 'fixtures', fixture
    );
  },

  makeMemoryStream(...args) {
    return new MemoryStream(...args);
  }
}

// Remove all containers before run
before(function() {
  console.log("Before all tasks:");
  this.timeout(0);

  var result = Q.async(function* () {
    var containers = yield docker.listContainers({ all: true });
    console.log(" - Removing %s containers before run tests", containers.length);
    return Q.all(_.map(containers, (container) => {
      return docker.getContainer(container.Id).remove({ force: true });
    }));
  })();

  return result.then(() => console.log("\n"));
});

// Helpers
require('spec/spec_helpers/mock_outputs').extend(Helpers);

export default Helpers;
{'fraction_non_alphanumeric': 0.17649812734082396, 'fraction_numerical': 0.00046816479400749064, 'mean_word_length': 4.199513381995134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4892955', 'n_tokens_mistral': 724, 'n_tokens_neox': 714, 'n_words': 156}