<commit_before>const fs = require('fs')
const mv = require('mv')

function test () {
  console.log('hi')
}

const testFolder = '/Users/ZachO/Code/The_Archiver/tests'
var filesList = []
fs.readdir(testFolder, (err, files) => {
  files.forEach(file => {
    console.log(file)
    filesList.push(file)
  })
})
console.log(filesList)
// mv('/Users/ZachO/Code/The_Archiver/tests/test1.txt', '/Users/ZachO/Code/The_Archiver/test1.txt', function (err) {
//   console.log('Error in file ')
// })

// mv('/tests/test1.txt', 'test1.txt', function (err) {
//   console.log('Error in file moving')
// })
function down () {
  for (var i = 0; i < filesList.length; i++) {
    mv('/Users/ZachO/Code/The_Archiver/tests/' + filesList[i], '/Users/ZachO/Code/The_Archiver/' + filesList[i], function (err) {
      if (typeof err !== 'undefined') {
          // the variable is defined
        console.log('error on down function file: ' + filesList[i])
        console.log(translate(err.code))
      } else {
        console.log('down function completed succesfully on file: ' + filesList[i])
      }
    })
  }
}
function up () {
  for (var i = 0; i < filesList.length; i++) {
    mv('/Users/ZachO/Code/The_Archiver/' + filesList[i], '/Users/ZachO/Code/The_Archiver/tests/' + filesList[i], function (err) {
      if (typeof err !== 'undefined') {
          // the variable is defined
        console.log('error on up function file: ' + filesList[i])
        console.log(translate(err.code))
      } else {
        console.log('up function completed succesfully on file: ' + filesList[i])
      }
    })
  }
}

function onedown () {
  mv('/Users/ZachO/Code/The_Archiver/tests/test1.txt', '/Users/ZachO/Code/The_Archiver/test1.txt', function (err) {
    if (typeof err !== 'undefined') {
        // the variable is defined
      console.log('error on down function')
      console.log(translate(err.code))
    } else {
      console.log('down function completed succesfully')
    }
  })
}
function oneup () {
  mv('/Users/ZachO/Code/The_Archiver/test1.txt', '/Users/ZachO/Code/The_Archiver/tests/test1.txt', function (err) {
    if (typeof err !== 'undefined') {
        // the variable is defined
      console.log('error on up function')
      console.log(translate(err.code))
    } else {<commit_msg>using a foreach loop instead of for loop because of insane node shit<commit_after>const fs = require('fs')
const mv = require('mv')

function test () {
  console.log('hi')
}

const testFolder = '/Users/ZachO/Code/The_Archiver/tests'
var filesList = []
fs.readdir(testFolder, (err, files) => {
  files.forEach(file => {
    console.log(file)
    filesList.push(file)
  })
})
console.log(filesList)
// mv('/Users/ZachO/Code/The_Archiver/tests/test1.txt', '/Users/ZachO/Code/The_Archiver/test1.txt', function (err) {
//   console.log('Error in file ')
// })

// mv('/tests/test1.txt', 'test1.txt', function (err) {
//   console.log('Error in file moving')
// })
function down () {
  filesList.forEach(function(file){
    mv('/Users/ZachO/Code/The_Archiver/tests/' + file, '/Users/ZachO/Code/The_Archiver/' + file, function (err) {
      if (typeof err !== 'undefined') {
          // the variable is defined
        console.log('error on down function file: ' + file)
        console.log(translate(err.code))
      } else {
        console.log('down function completed succesfully on file: ' + file)
      }
    })
  })
}
function up () {
  filesList.forEach(function(file){
    mv('/Users/ZachO/Code/The_Archiver/' + file, '/Users/ZachO/Code/The_Archiver/tests/' + file, function (err) {
      if (typeof err !== 'undefined') {
          // the variable is defined
        console.log('error on down function file: ' + file)
        //printing an error statment on what file errored
        console.log(translate(err.code))
        //printing the tranlation of the error code
      } else {
        console.log('down function completed succesfully on file: ' + file)
      }
    })
  })
}

function onedown () {
  mv('/Users/ZachO/Code/The_Archiver/tests/test1.txt', '/Users/ZachO/Code/The_Archiver/test1.txt', function (err) {
    if (typeof err !== 'undefined') {
        // the variable is defined
      console.log('error on down function')
      console.log(translate(err.code))
    } else {
      console.log('down function completed succesfully')
    }
  })
}
function oneup () {
  mv('/Users/ZachO/Code/The_Archiver/test1.txt', '/Users/ZachO/Code/The_Archiver/tests/test1.txt', function (err) {
    if (typeof err !== 'undefined') {
        // the variable is defined
      console.log('error on up function')
      console.log(translate(err.code))
    } else {
{'fraction_non_alphanumeric': 0.16433641643364164, 'fraction_numerical': 0.003871800387180039, 'mean_word_length': 2.920741989881956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5148206', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1538, 'n_words': 327}