<commit_before>var auth = require('./auth');
var mraa = require('mraa');
var flex = require('./flex');
var accel = require('./accel');
var touch = require('./touch');
var bluetooth = require('./bluetooth');
var q = require('q');
var exec = require("child_process").exec;

auth({ host : "10.10.107.39" }).then(function(ddp){
  console.log("Connected", ddp.user.id);

  // Store bluetooth address
  // var bt = exec("rfkill unblock bluetooth && bluetoothctl discoverable on");
  // bt.once('data', function(result){
  //   var mac = /.{2}:.{2}:.{2}:.{2}:.{2}:.{2}/img.exec(result);
  //   ddp.call("setBluetoothMac", [mac]);
  // })

  function self() {
    var user = ddp.collections.users[ddp.user.id];
    user.voice = user.profile.name == "thomas" ? "Alex" : "Veena";
    return user;
  }

  var selfPromise = q.ninvoke(ddp, 'subscribe', 'userStatus', []).then(self);

  function runDemo(me, ddp){
    ddp.call('speak', ['Are you ready to play?', me.voice]);
    // turn head to dance mode
    changeFace(ddp,3);
    myUln200xa_obj.goForward();

    q.delay(2000)
      .then(function(){ 
        ddp.call('speak', ['Lets dance together!', me.voice]);
        return q.nfcall(touch,6);
      })
      .then(function(){
        ddp.call('speak', ["A fancy, dancy!", me.voice]);
        return q.delay(1000).then(function(){
          ddp.call('speak', ["Yay, we are dancing!", me.voice]);
        });
        myUln200xa_obj.goForward();
        return 1;
      })
      .then(function(){
        ddp.call('addMessage', 'seconddemo', 'lisa');<commit_msg>Fix addMessage usage<commit_after>var auth = require('./auth');
var mraa = require('mraa');
var flex = require('./flex');
var accel = require('./accel');
var touch = require('./touch');
var bluetooth = require('./bluetooth');
var q = require('q');
var exec = require("child_process").exec;

auth({ host : "10.10.107.39" }).then(function(ddp){
  console.log("Connected", ddp.user.id);

  // Store bluetooth address
  // var bt = exec("rfkill unblock bluetooth && bluetoothctl discoverable on");
  // bt.once('data', function(result){
  //   var mac = /.{2}:.{2}:.{2}:.{2}:.{2}:.{2}/img.exec(result);
  //   ddp.call("setBluetoothMac", [mac]);
  // })

  function self() {
    var user = ddp.collections.users[ddp.user.id];
    user.voice = user.profile.name == "thomas" ? "Alex" : "Veena";
    return user;
  }

  var selfPromise = q.ninvoke(ddp, 'subscribe', 'userStatus', []).then(self);

  function runDemo(me, ddp){
    ddp.call('speak', ['Are you ready to play?', me.voice]);
    // turn head to dance mode
    changeFace(ddp,3);
    myUln200xa_obj.goForward();

    q.delay(2000)
      .then(function(){ 
        ddp.call('speak', ['Lets dance together!', me.voice]);
        return q.nfcall(touch,6);
      })
      .then(function(){
        ddp.call('speak', ["A fancy, dancy!", me.voice]);
        return q.delay(1000).then(function(){
          ddp.call('speak', ["Yay, we are dancing!", me.voice]);
        });
        myUln200xa_obj.goForward();
        return 1;
      })
      .then(function(){
        console.log("forward to lisa next");
        ddp.call('addMessage', ['seconddemo', 'lisa']);
{'fraction_non_alphanumeric': 0.20936116382036685, 'fraction_numerical': 0.02024035420619861, 'mean_word_length': 3.055128205128205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4570152', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1089, 'n_words': 231}