<commit_before>module HTTMultiParty::Multipartable
  DEFAULT_BOUNDARY = "-----------RubyMultipartPost"
  # prevent reinitialization of headers
  def initialize_http_header(initheader)
    super if @header.nil?
  end

  def body=(value)
    boundary = DEFAULT_BOUNDARY
    parts = value.map {|(k,v)| Parts::Part.new(boundary, k, v)}
    parts << Parts::EpiloguePart.new(boundary)
    self.set_content_type("multipart/form-data", { "boundary" => boundary })
    self.content_length = parts.inject(0) {|sum,i| sum + i.length }
    self.body_stream = CompositeReadIO.new(*parts.map(&:to_io))
  end
end<commit_msg>fix for ruby 1.8.6 which doesn't support symbol to proc magic<commit_after>module HTTMultiParty::Multipartable
  DEFAULT_BOUNDARY = "-----------RubyMultipartPost"
  # prevent reinitialization of headers
  def initialize_http_header(initheader)
    super if @header.nil?
  end

  def body=(value)
    boundary = DEFAULT_BOUNDARY
    parts = value.map {|(k,v)| Parts::Part.new(boundary, k, v)}
    parts << Parts::EpiloguePart.new(boundary)
    self.set_content_type("multipart/form-data", { "boundary" => boundary })
    self.content_length = parts.inject(0) {|sum,i| sum + i.length }
    self.body_stream = CompositeReadIO.new(*parts.map { |part| part.to_io })
  end
end
{'fraction_non_alphanumeric': 0.1422986708365911, 'fraction_numerical': 0.003909304143862392, 'mean_word_length': 4.203252032520325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4103923', 'n_tokens_mistral': 443, 'n_tokens_neox': 419, 'n_words': 87}