<commit_before>class @SocketHash
  constructor: ->
    @sockets = {}

  add: (socket) ->
    if !@containsSocket(socket)
      @sockets[socket.id] ?= []
      @sockets[socket.id].push(socket)
    @sockets[socket.id].length

  remove: (socket) ->
    array = @sockets[socket.id]
    return false  if !array
    index = array.indexOf(socket)
    return false  if index == -1
    array.splice(index, 1)
    array.length

  contains: (socketId) ->
    @sockets[socketId]?

  containsSocket: (socket) ->
    for id, array of @sockets
      if socket in array
        return true
    return false

  send: (socketId, args...) ->
    for socket in @sockets[socketId] || []
      socket.send(args...)
<commit_msg>Sim: When someone leaves, they're removed from the user hash.<commit_after>class @SocketHash
  constructor: ->
    @sockets = {}

  add: (socket) ->
    if !@containsSocket(socket)
      @sockets[socket.id] ?= []
      @sockets[socket.id].push(socket)
    @sockets[socket.id].length

  remove: (socket) ->
    array = @sockets[socket.id]
    return 0  if !array
    index = array.indexOf(socket)
    return array.length  if index == -1
    array.splice(index, 1)
    length = array.length
    delete @sockets[socket.id]  if length == 0
    return length

  contains: (socketId) ->
    @sockets[socketId]?

  containsSocket: (socket) ->
    for id, array of @sockets
      if socket in array
        return true
    return false

  send: (socketId, args...) ->
    for socket in @sockets[socketId] || []
      socket.send(args...)

{'fraction_non_alphanumeric': 0.13941368078175895, 'fraction_numerical': 0.003908794788273616, 'mean_word_length': 2.6226415094339623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3679642', 'n_tokens_mistral': 512, 'n_tokens_neox': 496, 'n_words': 127}