<commit_before>require 'eventmachine'
require 'em/buftok'
require 'uri'
require 'simple_oauth'
require 'http/parser'

module Twitter
  class JSONStream < EventMachine::Connection
    MAX_LINE_LENGTH = 1024*1024

    # network failure reconnections
    NF_RECONNECT_START = 0.25
    NF_RECONNECT_ADD   = 0.25
    NF_RECONNECT_MAX   = 16

    # app failure reconnections
    AF_RECONNECT_START = 10
    AF_RECONNECT_MUL   = 2

    RECONNECT_MAX   = 320
    RETRIES_MAX     = 10

    NO_DATA_TIMEOUT = 90

    DEFAULT_OPTIONS = {
      :method         => 'GET',
      :path           => '/',
      :content_type   => "application/x-www-form-urlencoded",
      :content        => '',
      :path           => '/1/statuses/filter.json',
      :host           => 'stream.twitter.com',
      :port           => 443,
      :ssl            => true,
      :user_agent     => 'TwitterStream',
      :timeout        => 0,
      :proxy          => ENV['HTTP_PROXY'],
      :auth           => nil,
      :oauth          => {},
      :filters        => [],
      :params         => {},
      :auto_reconnect => true
    }

    attr_accessor :code
    attr_accessor :headers
    attr_accessor :nf_last_reconnect
    attr_accessor :af_last_reconnect
    attr_accessor :reconnect_retries
    attr_accessor :last_data_received_at
    attr_accessor :proxy<commit_msg>Fix duplicate key(:path) specified<commit_after>require 'eventmachine'
require 'em/buftok'
require 'uri'
require 'simple_oauth'
require 'http/parser'

module Twitter
  class JSONStream < EventMachine::Connection
    MAX_LINE_LENGTH = 1024*1024

    # network failure reconnections
    NF_RECONNECT_START = 0.25
    NF_RECONNECT_ADD   = 0.25
    NF_RECONNECT_MAX   = 16

    # app failure reconnections
    AF_RECONNECT_START = 10
    AF_RECONNECT_MUL   = 2

    RECONNECT_MAX   = 320
    RETRIES_MAX     = 10

    NO_DATA_TIMEOUT = 90

    DEFAULT_OPTIONS = {
      :method         => 'GET',
      :content_type   => "application/x-www-form-urlencoded",
      :content        => '',
      :path           => '/1/statuses/filter.json',
      :host           => 'stream.twitter.com',
      :port           => 443,
      :ssl            => true,
      :user_agent     => 'TwitterStream',
      :timeout        => 0,
      :proxy          => ENV['HTTP_PROXY'],
      :auth           => nil,
      :oauth          => {},
      :filters        => [],
      :params         => {},
      :auto_reconnect => true
    }

    attr_accessor :code
    attr_accessor :headers
    attr_accessor :nf_last_reconnect
    attr_accessor :af_last_reconnect
    attr_accessor :reconnect_retries
    attr_accessor :last_data_received_at
    attr_accessor :proxy
{'fraction_non_alphanumeric': 0.10279329608938548, 'fraction_numerical': 0.02309124767225326, 'mean_word_length': 2.0384615384615383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5688101', 'n_tokens_mistral': 909, 'n_tokens_neox': 846, 'n_words': 163}