<commit_before>const _ = require('lodash');
const path = require('path');
const colors = require('colors');

const Promise = require('bluebird');
const fs = Promise.promisifyAll(require('fs'));
const request = Promise.promisifyAll(require('request'));

const util = require('./util');
const defaults = require('./defaults');
const authenticate = require('./authenticate');

/**
  build generates a manifest to be uploaded to google drive
  @param externalFiles {Object} files in the cloud
  @return {Object} manifest
 */
const build = function(externalFiles) {
  return getConfig().get('path')
    .then(util.getFilesFromDisk)
    .then((files) => {

      // for each manifest file, if it has an equivalent on disk, keep it
      // otherwise trash it
      const filesToUpload = _.filter(
        externalFiles, 
        (externalFile) => util.hasFileOnDisk(files, externalFile)
      );

      _.each(files, (file) => {
        // Add new file or update existing record
        const manifestFile = getFileInManifest(filesToUpload, file);<commit_msg>Tells bluebird to promisify all arguments<commit_after>const _ = require('lodash');
const path = require('path');
const colors = require('colors');

const Promise = require('bluebird');
const fs = Promise.promisifyAll(require('fs'));
const request = Promise.promisifyAll(require('request'), {multiArgs: true})

const util = require('./util');
const defaults = require('./defaults');
const authenticate = require('./authenticate');

/**
  build generates a manifest to be uploaded to google drive
  @param externalFiles {Object} files in the cloud
  @return {Object} manifest
 */
const build = function(externalFiles) {
  return getConfig().get('path')
    .then(util.getFilesFromDisk)
    .then((files) => {

      // for each manifest file, if it has an equivalent on disk, keep it
      // otherwise trash it
      const filesToUpload = _.filter(
        externalFiles, 
        (externalFile) => util.hasFileOnDisk(files, externalFile)
      );

      _.each(files, (file) => {
        // Add new file or update existing record
        const manifestFile = getFileInManifest(filesToUpload, file);
{'fraction_non_alphanumeric': 0.12871747211895912, 'fraction_numerical': 0.0, 'mean_word_length': 3.7844444444444445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7202573', 'n_tokens_mistral': 586, 'n_tokens_neox': 573, 'n_words': 184}