<commit_before>var mqtt = require('mqtt');

var thngId='UWFd8YMe8VKwfYDxUhbUkrNh'
var thngUrl='/thngs/'+thngId

// This is using the unsecure version - for simplicity's sake - obviously, don't use it in production
var client = mqtt.connect("mqtt://mqtt.evrythng.com:1883", {
  username: 'authorization',
  password: 'kjNzrcvYNFbCgL9KVuWf0vX9VneBWOuriQlUOI7mGXd50Ww6IOeh45vQwXxiCbg5nFvTGzxpHZph7AUO' //Your device API KEY
});

client.on('connect', function () { // Called once when connected
  client.subscribe(thngUrl+'/properties/');
  client.subscribe(thngUrl+'/actions/');
  setTimeout(updateProperty, 2000); // We set a callback in 2 seconds
});

// This will be called every time a property is updated or an event changes
client.on('message', function (topic, message) {
  console.log(message.toString());
});

// update a property
function updateProperty () {
  // Let's set the light in a random time span
  var level = Math.round(Math.random()*1000);
  client.publish(thngUrl+'/properties/lightlevel', '[{"value": '+level+'}]');
  setTimeout(updateProperty, 5000); // We set a callback in 2 seconds
}



// Let's close this connection cleanly
process.on('SIGINT', function() {
  client.publish(thngUrl+'/properties/connectedat', '[{"value": false}]');
  client.end();
  process.exit();
});<commit_msg>Removing connectedat<commit_after>var mqtt = require('mqtt');

var thngId='UWFd8YMe8VKwfYDxUhbUkrNh'
var thngUrl='/thngs/'+thngId

// This is using the unsecure version - for simplicity's sake - obviously, don't use it in production
var client = mqtt.connect("mqtt://mqtt.evrythng.com:1883", {
  username: 'authorization',
  password: 'kjNzrcvYNFbCgL9KVuWf0vX9VneBWOuriQlUOI7mGXd50Ww6IOeh45vQwXxiCbg5nFvTGzxpHZph7AUO' //Your device API KEY
});

client.on('connect', function () { // Called once when connected
  client.subscribe(thngUrl+'/properties/');
  client.subscribe(thngUrl+'/actions/');
  setTimeout(updateProperty, 2000); // We set a callback in 2 seconds
});

// This will be called every time a property is updated or an event changes
client.on('message', function (topic, message) {
  console.log(message.toString());
});

// update a property
function updateProperty () {
  // Let's set the light in a random time span
  var level = Math.round(Math.random()*1000);
  client.publish(thngUrl+'/properties/lightlevel', '[{"value": '+level+'}]');
  setTimeout(updateProperty, 5000); // We set a callback in 2 seconds
}


// Let's close this connection cleanly
process.on('SIGINT', function() {
  client.end();
  process.exit();
});
{'fraction_non_alphanumeric': 0.1463318948607297, 'fraction_numerical': 0.024323264025107885, 'mean_word_length': 5.0, 'pattern_counts': {'":': 3, '<': 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': '320703', 'n_tokens_mistral': 926, 'n_tokens_neox': 874, 'n_words': 218}