<commit_before>import child_process from 'child_process'
import _ from 'lodash'
import chalk from 'chalk'
import outputConsole from './output'

export default function execute (options) {
  const formatOptions = [
    '{{.ID}}', '{{.Names}}', '{{.Image}}', '{{.Command}}',
    '{{.CreatedAt}}', '{{.RunningFor}}', '{{.Status}}', '{{.Ports}}'
  ]
  const format = _.join(formatOptions, '\t')

  const output = child_process.execSync(`docker ps ${options} --format "${format}"`).toString()

  let containers = []

  for (let row of output.split('\n')) {
    if (row === '') continue
    const data = row.split('\t')
    let container = {
      id: data[0],
      name: data[1],
      image: data[2],
      command: data[3],
      createdAt: data[4],
      runningFor: data[5],
      status: data[6],
      ports: data[7]
    }
    containers.push(container)
  }

  if (containers.length === 0) {
    console.log(options)
    return chalk.magenta('There are no running containers.') + '\n' +
      `Use ${chalk.blue('-a, --all')} option to show all containers.`
  }<commit_msg>remove unnecessary console.log()<commit_after>import child_process from 'child_process'
import _ from 'lodash'
import chalk from 'chalk'
import outputConsole from './output'

export default function execute (options) {
  const formatOptions = [
    '{{.ID}}', '{{.Names}}', '{{.Image}}', '{{.Command}}',
    '{{.CreatedAt}}', '{{.RunningFor}}', '{{.Status}}', '{{.Ports}}'
  ]
  const format = _.join(formatOptions, '\t')

  const output = child_process.execSync(`docker ps ${options} --format "${format}"`).toString()

  let containers = []

  for (let row of output.split('\n')) {
    if (row === '') continue
    const data = row.split('\t')
    let container = {
      id: data[0],
      name: data[1],
      image: data[2],
      command: data[3],
      createdAt: data[4],
      runningFor: data[5],
      status: data[6],
      ports: data[7]
    }
    containers.push(container)
  }

  if (containers.length === 0) {
    return chalk.magenta('There are no running containers.') + '\n' +
      `Use ${chalk.blue('-a, --all')} option to show all containers.`
  }
{'fraction_non_alphanumeric': 0.19607843137254902, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 3.185546875, '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': '1493967', 'n_tokens_mistral': 714, 'n_tokens_neox': 700, 'n_words': 185}