<commit_before>// This part should be in a module.

module.exports = function() {

  //require the needed modules
  var Leap = require('leapjs');
  var spheron = require('spheron');

  // Set this to the device Sphero connects as on your computer.
  var device = '/dev/tty.Sphero-RBR-AMP-SPP';

  var safeMode = true; //Turn this off if Sphero is in water or you like to live dangerously!

  var controlSphero = function(sphero) {

  	var controller = new Leap.Controller({frameEventName:'deviceFrame', enableGestures:true});

      //Debugging console messages to make sure the Leap Motion is connected and working.
      controller.on('connect', function() {
      	console.log('connected to leap motion');
      });
      controller.on('ready', function() {
          console.log('ready');
      });
      controller.on('focus', function() {
          console.log('focus?');
      });
      controller.on('deviceStreaming', function() {
          console.log('device connected');
      });
      controller.on('deviceStopped', function() {
          console.log('device disconnected');
      });
      controller.on('frame', function(frame) {
          if (frame.gestures.length) {
            var g = frame.gestures[0];

            //Basically checks if there is movement. Need to try without the 'stop' one.
            if (g.type == 'swipe' && g.state ==='stop') {
              handleSwipe(g);
            }
          }
      });

      var handleSwipe = function(g) {<commit_msg>Refactor by removing unnecessary comments<commit_after>module.exports = function() {

  var Leap = require('leapjs');
  var spheron = require('spheron');

  // Set this to the device Sphero connects as on your computer.
  var device = '/dev/tty.Sphero-RBR-AMP-SPP';

  var safeMode = true; //Turn this off if Sphero is in water or you like to live dangerously!

  var controlSphero = function(sphero) {
  	var controller = new Leap.Controller({frameEventName:'deviceFrame', enableGestures:true});
      controller.on('connect', function() {
      	console.log('connected to leap motion');
      });
      controller.on('ready', function() {
          console.log('ready');
      });
      controller.on('focus', function() {
          console.log('focus?');
      });
      controller.on('deviceStreaming', function() {
          console.log('device connected');
      });
      controller.on('deviceStopped', function() {
          console.log('device disconnected');
      });
      controller.on('frame', function(frame) {
          if (frame.gestures.length) {
            var g = frame.gestures[0];

            if (g.type == 'swipe' && g.state ==='stop') {
              handleSwipe(g);
            }
          }
      });

      var handleSwipe = function(g) {
{'fraction_non_alphanumeric': 0.14010889292196008, 'fraction_numerical': 0.0007259528130671506, 'mean_word_length': 2.4710327455919394, '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': '3189899', 'n_tokens_mistral': 781, 'n_tokens_neox': 760, 'n_words': 208}