<commit_before>import color from '@heroku-cli/color'
import {APIClient, Command, flags} from '@heroku-cli/command'
import Heroku from '@heroku-cli/schema'
import {assert} from 'chai'
import cli from 'cli-ux'
import got from 'got'

import {listPipelineApps} from '../../api'
import keyBy from '../../key-by'

function assertNotPromotingToSelf(source: string, target: string) {
  assert.notStrictEqual(source, target, `Cannot promote from an app to itself: ${target}. Specify a different target app.`)
}

function findAppInPipeline(apps: Array<Heroku.App>, target: string) {
  const found = apps.find(app => (app.name === target) || (app.id === target))
  assert(found, `Cannot find app ${color.app(target)}`)

  return found
}

const PROMOTION_ORDER = ['development', 'staging', 'production']

// tslint:disable-next-line: no-string-based-set-timeout
const wait = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms))

function isComplete(promotionTarget: Heroku.PipelinePromotionTarget) {
  return promotionTarget.status !== 'pending'
}

function isSucceeded(promotionTarget: Heroku.PipelinePromotionTarget) {
  return promotionTarget.status === 'succeeded'
}

function isFailed(promotionTarget: Heroku.PipelinePromotionTarget) {<commit_msg>fix(pipelines): Use assert from node instead of chai (#1342)<commit_after>import color from '@heroku-cli/color'
import {APIClient, Command, flags} from '@heroku-cli/command'
import Heroku from '@heroku-cli/schema'
import assert from 'assert'
import cli from 'cli-ux'
import got from 'got'

import {listPipelineApps} from '../../api'
import keyBy from '../../key-by'

function assertNotPromotingToSelf(source: string, target: string) {
  assert.notStrictEqual(source, target, `Cannot promote from an app to itself: ${target}. Specify a different target app.`)
}

function findAppInPipeline(apps: Array<Heroku.App>, target: string) {
  const found = apps.find(app => (app.name === target) || (app.id === target))
  assert(found, `Cannot find app ${color.app(target)}`)

  return found
}

const PROMOTION_ORDER = ['development', 'staging', 'production']

// tslint:disable-next-line: no-string-based-set-timeout
const wait = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms))

function isComplete(promotionTarget: Heroku.PipelinePromotionTarget) {
  return promotionTarget.status !== 'pending'
}

function isSucceeded(promotionTarget: Heroku.PipelinePromotionTarget) {
  return promotionTarget.status === 'succeeded'
}

function isFailed(promotionTarget: Heroku.PipelinePromotionTarget) {
{'fraction_non_alphanumeric': 0.13831041257367388, 'fraction_numerical': 0.003929273084479371, 'mean_word_length': 5.68241469816273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '974593', 'n_tokens_mistral': 786, 'n_tokens_neox': 774, 'n_words': 218}