<commit_before>var chalk = require('chalk');
var fs    = require('fs-extra');
var path  = require('path');
var gutil = require('gulp-util');
var startTime = new Date();
var timeout; 

var run = function (func, testEvent, testEnv) {
  var folderPath = path.join(process.cwd(), '/functions', '/' + func);
  if (!fs.existsSync(folderPath)) {
    console.log('Could not find function:', func);
    console.log('Make sure you are using `lamb run` from your project root directory.');
    process.exit();
  }

  var data = JSON.parse(fs.readFileSync(path.join(folderPath, 'lambinator.json'), {encoding:'utf-8'}));
  timeout = data.timeout ? (data.timeout * 1000) : 300000;

  //change working directory
  var funcDir = process.cwd() + '/functions/' + func;
  if (!fs.existsSync(funcDir)) {
    console.log('Could not find a function to run at:', funcDir);
    console.log('Make sure you are using `lamb run` from your project root directory.');
    process.exit();
  }

  console.log('Changing working directory to:', funcDir);
  process.chdir(funcDir);
<commit_msg>adding env for process.env.lambinator<commit_after>var chalk = require('chalk');
var fs    = require('fs-extra');
var path  = require('path');
var gutil = require('gulp-util');
var startTime = new Date();
var timeout; 

var run = function (func, testEvent, testEnv) {
  var folderPath = path.join(process.cwd(), '/functions', '/' + func);
  if (!fs.existsSync(folderPath)) {
    console.log('Could not find function:', func);
    console.log('Make sure you are using `lamb run` from your project root directory.');
    process.exit();
  }

  var data = JSON.parse(fs.readFileSync(path.join(folderPath, 'lambinator.json'), {encoding:'utf-8'}));
  timeout = data.timeout ? (data.timeout * 1000) : 300000;

  //change working directory
  var funcDir = process.cwd() + '/functions/' + func;
  if (!fs.existsSync(funcDir)) {
    console.log('Could not find a function to run at:', funcDir);
    console.log('Make sure you are using `lamb run` from your project root directory.');
    process.exit();
  }

  console.log('Changing working directory to:', funcDir);
  process.chdir(funcDir);

  //set env for lambinator
  process.env.lambinator = true;

{'fraction_non_alphanumeric': 0.15873015873015872, 'fraction_numerical': 0.009977324263038548, 'mean_word_length': 4.130232558139535, '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': '6672396', 'n_tokens_mistral': 714, 'n_tokens_neox': 689, 'n_words': 203}