<commit_before>var docker = require('docker-remote-api')
var after = require('after-all')

var noop = function() {}

module.exports = function(opts, cb) {
  if (typeof opts === 'function') return module.exports(null, opts)
  if (!opts) opts = {}
  if (!cb) cb = noop

  var request = docker(opts.host, {version:'v1.14'})
  var result = {containers:0, images:0}

  var cleanContainers = function(cb) {
    request.get('/containers/json', {json:true, qs:{all:true}}, function(err, containers) {
      if (err) return cb(err)

      var next = after(cb)

      containers.forEach(function(c) {
        var n = next()

        request.get('/containers/'+c.Id+'/json', {json:true}, function(err, c) {
          if (err) return n(err)
          if (!opts.force && c.State && c.State.Running) return n()

          result.containers++
          request.del('/containers/'+c.Id, {drain:true, qs:{force:!!opts.force}}, n)
        })<commit_msg>bump version<commit_after>var docker = require('docker-remote-api')
var after = require('after-all')

var noop = function() {}

module.exports = function(opts, cb) {
  if (typeof opts === 'function') return module.exports(null, opts)
  if (!opts) opts = {}
  if (!cb) cb = noop

  var request = docker(opts.host, {version:'v1.15'})
  var result = {containers:0, images:0}

  var cleanContainers = function(cb) {
    request.get('/containers/json', {json:true, qs:{all:true}}, function(err, containers) {
      if (err) return cb(err)

      var next = after(cb)

      containers.forEach(function(c) {
        var n = next()

        request.get('/containers/'+c.Id+'/json', {json:true}, function(err, c) {
          if (err) return n(err)
          if (!opts.force && c.State && c.State.Running) return n()

          result.containers++
          request.del('/containers/'+c.Id, {drain:true, qs:{force:!!opts.force}}, n)
        })
{'fraction_non_alphanumeric': 0.18084537185660782, 'fraction_numerical': 0.005350454788657036, 'mean_word_length': 3.1371681415929205, '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': '5761620', 'n_tokens_mistral': 637, 'n_tokens_neox': 618, 'n_words': 145}