<commit_before>var app     = require('express')(),
  http    = require('http').Server(app),
  io      = require('socket.io')(http, {serveClient: false} ),
  clients   = [],
  syncObjs  = {knockoutObjects: {}},
  port    = 4000;

http.listen( port, function(){
  console.log('listening on *:'+port);
});


io.on('connection', function(socket) {

  clients.push(socket);

  socket.emit("message",syncObjs);

  socket.on('message', function(message) {
    // append sync values to temporary storage
    // here you could block people trying to manually update via socket.send live readonly observables with named IDs
    syncObjs['knockoutObjects'][message.id] = message.value;
    for(var i=0,j=clients.length; i < j;i++ ) {
        if(clients[i].id !== socket.id)
            clients[i].emit("message",message); 
    }
  });

  socket.on('disconnect', function(){
      for(var i=0,j=clients.length; i < j;i++ ) {
          if(!!clients[i]['id'])
              if(clients[i].id == socket.id)
                  clients.splice(i,1);
      }
        console.log(socket.id,'disconnected ------------- ');
        console.log(clients);
  });

});
<commit_msg>indentation<commit_after>var app     = require('express')(),
  http      = require('http').Server(app),
  io        = require('socket.io')(http, {serveClient: false} ),
  clients   = [],
  syncObjs  = {knockoutObjects: {}},
  port      = 4000;

http.listen( port, function(){
  console.log('listening on *:'+port);
});


io.on('connection', function(socket) {

  clients.push(socket);

  socket.emit("message",syncObjs);

  socket.on('message', function(message) {
    // append sync values to temporary storage
    // here you could block people trying to manually update via socket.send live readonly observables with named IDs
    syncObjs['knockoutObjects'][message.id] = message.value;
    for(var i=0,j=clients.length; i < j;i++ ) {
        if(clients[i].id !== socket.id)
            clients[i].emit("message",message); 
    }
  });

  socket.on('disconnect', function(){
      for(var i=0,j=clients.length; i < j;i++ ) {
          if(!!clients[i]['id'])
              if(clients[i].id == socket.id)
                  clients.splice(i,1);
      }
        console.log(socket.id,'disconnected ------------- ');
        console.log(clients);
  });

});

{'fraction_non_alphanumeric': 0.18614718614718614, 'fraction_numerical': 0.006060606060606061, 'mean_word_length': 2.7947454844006567, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5055292', 'n_tokens_mistral': 760, 'n_tokens_neox': 741, 'n_words': 140}