<commit_before>import {
  CURRENT_LOCKFILE,
  WANTED_LOCKFILE,
} from '@pnpm/constants'
import { Lockfile } from '@pnpm/lockfile-types'
import { DEPENDENCIES_FIELDS } from '@pnpm/types'
import yaml = require('js-yaml')
import makeDir = require('make-dir')
import path = require('path')
import R = require('ramda')
import rimraf = require('rimraf-then')
import { promisify } from 'util'
import writeFileAtomicCB = require('write-file-atomic')
import logger from './logger'

const writeFileAtomic = promisify(writeFileAtomicCB)

const LOCKFILE_YAML_FORMAT = {
  lineWidth: 1000,
  noCompatMode: true,
  noRefs: true,<commit_msg>fix: callback is not fn error in write-file-atomic<commit_after>import {
  CURRENT_LOCKFILE,
  WANTED_LOCKFILE,
} from '@pnpm/constants'
import { Lockfile } from '@pnpm/lockfile-types'
import { DEPENDENCIES_FIELDS } from '@pnpm/types'
import yaml = require('js-yaml')
import makeDir = require('make-dir')
import path = require('path')
import R = require('ramda')
import rimraf = require('rimraf-then')
import writeFileAtomicCB = require('write-file-atomic')
import logger from './logger'

function writeFileAtomic (filename: string, data: string) {
  return new Promise((resolve, reject) => writeFileAtomicCB(filename, data, {}, (err: Error) => err ? reject(err) : resolve()))
}

const LOCKFILE_YAML_FORMAT = {
  lineWidth: 1000,
  noCompatMode: true,
  noRefs: true,
{'fraction_non_alphanumeric': 0.13208901651112706, 'fraction_numerical': 0.00574300071787509, 'mean_word_length': 5.833333333333333, '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': '4607902', 'n_tokens_mistral': 474, 'n_tokens_neox': 461, 'n_words': 116}