<commit_before>require('tesselate') ({
  modules: {
    A: ['ambient-attx4', 'ambientL'],
    C: ['ambient-attx4', 'ambientR']
  },
}, function(tessel, modules) {
  var left = modules.ambientL;
  var right = modules.ambientR;
  var car = require('servo-car').use(tessel.port['B'], function () {
    console.log('Ready.')

    var leftTriggered = false;
    var rightTriggered = false;

    reset();
    console.log('Just sitting here minding my own business...');

    left.on('sound-trigger', function(data) {
      console.log('Left triggered', data);
      leftTriggered = true;
      car.right();
      setTimeout(function () {
        setTimeout(function () {
          reset();
        }, 500);
      }, 500);
    });
    right.on('sound-trigger', function (data) {
      console.log('Right triggered', data);
      rightTriggered = true;
      car.left();
      setTimeout(function () {
        car.back();
        setTimeout(function () {
          reset();
        }, 500);
      }, 500);
    });

    function react () {
      clearInterval(usual);
      if (leftTriggered) {
        car.right();
        setTimeout(function () {
          reset();
        }, 500);
      } else if (rightTriggered) {
        car.left();
        setTimeout(function () {
          reset();
        }, 500);
      }
    }

    function reset () {
      car.stop();
      leftTriggered = false;
      rightTriggered = false;
      left.setSoundTrigger(0.1243);
      right.setSoundTrigger(0.1113);
    }
  });
});<commit_msg>clean up file<commit_after>// Load the hardware
require('tesselate') ({
  modules: {
    A: ['ambient-attx4', 'ambientL'],
    C: ['ambient-attx4', 'ambientR']
  },
}, function(tessel, modules) {
  var left = modules.ambientL;
  var right = modules.ambientR;
  var car = require('servo-car').use(tessel.port['B'], function () {
    // Start the device (define trigger values in this function, below)
    reset();
    console.log('Just sitting here minding my own business...');

    // When we get a sound, on either side, run away
    left.on('sound-trigger', function(data) {
      left.clearSoundTrigger();
      console.log('Left triggered', data);
      car.right();
      setTimeout(function () {
        setTimeout(function () {
          reset();
        }, 500);
      }, 500);
    });
    right.on('sound-trigger', function (data) {
      right.clearSoundTrigger();
      console.log('Right triggered', data);
      car.left();
      setTimeout(function () {
        car.back();
        setTimeout(function () {
          reset();
        }, 500);
      }, 500);
    });

    // Once we've reacted, stop running and wait for triggers again
    function reset () {
      car.stop();
      left.setSoundTrigger(0.1243);
      right.setSoundTrigger(0.1113);
    }
  });
});
{'fraction_non_alphanumeric': 0.1630901287553648, 'fraction_numerical': 0.019313304721030045, 'mean_word_length': 2.279015240328253, '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': '689427', 'n_tokens_mistral': 889, 'n_tokens_neox': 851, 'n_words': 183}