<commit_before># http://www.w3.org/TR/html4/interact/forms.html#h-17.13
# without files:
# application/x-www-form-urlencoded  
# with files:
# multipart/form-data

require "mime/types"

class Multiparty
  attr_accessor :boundary
  attr_accessor :parts

  # Multiparty.new("my-boundary")
  # Multiparty.new(:boundary => "my-boundary")
  def initialize(options = {})
    case options
    when Hash
      @boundary = options[:boundary]
      @content_type = options[:content_type]
    when String 
      @boundary = options
    end
   
    @parts = {}
    @content_type ||= "multipart/form-data"
    @boundary ||= "multiparty-boundary-#{rand(1000000000)}"

    yield self if block_given?
  end

  def header
    "Content-Type: #{@content_type}; boundary=#{@boundary}\r\n"<commit_msg>Remove superfluous comments.<commit_after>require "mime/types"

class Multiparty
  attr_accessor :boundary
  attr_accessor :parts

  # Multiparty.new("my-boundary")
  # Multiparty.new(:boundary => "my-boundary")
  def initialize(options = {})
    case options
    when Hash
      @boundary = options[:boundary]
      @content_type = options[:content_type]
    when String 
      @boundary = options
    end
   
    @parts = {}
    @content_type ||= "multipart/form-data"
    @boundary ||= "multiparty-boundary-#{rand(1000000000)}"

    yield self if block_given?
  end

  def header
    "Content-Type: #{@content_type}; boundary=#{@boundary}\r\n"
{'fraction_non_alphanumeric': 0.13674614305750352, 'fraction_numerical': 0.0182328190743338, 'mean_word_length': 3.4874213836477987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7440791', 'n_tokens_mistral': 513, 'n_tokens_neox': 468, 'n_words': 91}