<commit_before>class WebSocketClientMock

  include EventEmitter

  def initialize(response)
    @response = response
    connect_mock
  end

  def connect_mock
    Thread.new do
      sleep(0.5)
      self.emit :open, EventMock.new
    end
  end

  def send(data)
    data_json = JSON.parse(data)

    janus_action_name = data_json['janus'].to_sym
    reply_message = @response[janus_action_name]

    Thread.new do
      sleep(0.5)
      self.emit :message, EventMock.new(reply_message)
    end
  end

  def close
    Thread.new do
      sleep(0.1)
      self.emit :close, EventMock.new
    end
  end
end<commit_msg>Updated client mock threads delay<commit_after>class WebSocketClientMock

  include EventEmitter

  def initialize(response)
    @response = response
    connect_mock
  end

  def connect_mock
    Thread.new do
      sleep(0.1)
      self.emit :open, EventMock.new
    end
  end

  def send(data)
    data_json = JSON.parse(data)

    janus_action_name = data_json['janus'].to_sym
    reply_message = @response[janus_action_name]

    Thread.new do
      sleep(0.1)
      self.emit :message, EventMock.new(reply_message)
    end
  end

  def close
    Thread.new do
      sleep(0.1)
      self.emit :close, EventMock.new
    end
  end
end
{'fraction_non_alphanumeric': 0.07802547770700637, 'fraction_numerical': 0.009554140127388535, 'mean_word_length': 2.6647230320699706, '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': '4713313', 'n_tokens_mistral': 431, 'n_tokens_neox': 418, 'n_words': 97}