<commit_before>const mqtt = require('mqtt')  
const client = mqtt.connect('mqtt://iot.eclipse.org')

var sys = require('sys')
var exec = require('child_process').exec;

function puts(error, stdout, stderr) { sys.puts(stdout) }

function espeak(phrase) {
  var sleep = require('sleep')
  exec("echo " + phrase + " | espeak -w audio.wav", puts);
  sleep.sleep(.5);
  exec("aplay audio.wav", puts);  
}

var state = 'closed'

client.on('connect', function () {  
  client.subscribe('lupe/open')
  client.subscribe('lupe/close')
  client.subscribe('lupe/say')

  client.subscribe('lupe/resetall')
  client.subscribe('lupe/headleft')
  client.subscribe('lupe/headright')

  client.subscribe('lupe/leftup')
  client.subscribe('lupe/leftdown')
  client.subscribe('lupe/leftfold')
  client.subscribe('lupe/leftunfold')

  client.subscribe('lupe/rightup')
  client.subscribe('lupe/rightdown')
  client.subscribe('lupe/rightfold')
  client.subscribe('lupe/rightunfold')<commit_msg>Update amikoo.js<commit_after>const mqtt = require('mqtt')  
const client = mqtt.connect('mqtt://iot.eclipse.org')

var sys = require('sys')
var exec = require('child_process').exec;

function puts(error, stdout, stderr) { sys.puts(stdout) }

function espeak(phrase) {
  var sleep = require('sleep')
  exec("echo " + phrase + " | espeak -w audio.wav", puts);
  sleep.msleep(500);
  exec("aplay audio.wav", puts);  
}

var state = 'closed'

client.on('connect', function () {  
  client.subscribe('lupe/open')
  client.subscribe('lupe/close')
  client.subscribe('lupe/say')

  client.subscribe('lupe/resetall')
  client.subscribe('lupe/headleft')
  client.subscribe('lupe/headright')

  client.subscribe('lupe/leftup')
  client.subscribe('lupe/leftdown')
  client.subscribe('lupe/leftfold')
  client.subscribe('lupe/leftunfold')

  client.subscribe('lupe/rightup')
  client.subscribe('lupe/rightdown')
  client.subscribe('lupe/rightfold')
  client.subscribe('lupe/rightunfold')
{'fraction_non_alphanumeric': 0.17360041088854647, 'fraction_numerical': 0.002054442732408834, 'mean_word_length': 5.1257861635220126, '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': '3203062', 'n_tokens_mistral': 684, 'n_tokens_neox': 670, 'n_words': 102}