<commit_before>module CrowdFlower
  class Unit < Base
    attr_reader :job
    
    def initialize(job)
      super job.connection
      @job = job
      connect
    end

    def resource_uri
      "/jobs/#{@job.id}/units"
    end
    
    def all(page = 1, limit = 1000)
      connection.get(resource_uri, {:query => {:limit => limit, :page => page}})
    end
    
    def get(id)
      connection.get("#{resource_uri}/#{id}")
    end
    
    def ping
      connection.get("#{resource_uri}/ping")
    end
    
    def judgments(id)
      connection.get("#{resource_uri}/#{id}/judgments")
    end
    
    def create(data, gold = false)
      connection.post(resource_uri, {:query => {:unit => {:data => data.to_json, :golden => gold}}})
    end
    
    def copy(unit_id, job_id, data = {})
      connection.get("#{resource_uri}/#{unit_id}/copy", {:query => {:unit => {:job_id => job_id, :data => data}}})
    end
    
    def split(on, with = " ")
      connection.get("#{resource_uri}/split", {:query => {:on => on, :with => with}})
    end
    
    def cancel(unit_id)
      connection.post("#{resource_uri}/#{unit_id}/cancel.json")
    end
  end
end<commit_msg>changing unit create call to post<commit_after>module CrowdFlower
  class Unit < Base
    attr_reader :job
    
    def initialize(job)
      super job.connection
      @job = job
      connect
    end

    def resource_uri
      "/jobs/#{@job.id}/units"
    end
    
    def all(page = 1, limit = 1000)
      connection.get(resource_uri, {:query => {:limit => limit, :page => page}})
    end
    
    def get(id)
      connection.get("#{resource_uri}/#{id}")
    end
    
    def ping
      connection.get("#{resource_uri}/ping")
    end
    
    def judgments(id)
      connection.get("#{resource_uri}/#{id}/judgments")
    end
    
    def create(data, gold = false)
      connection.post(resource_uri, {:body => {:unit => {:data => data.to_json, :golden => gold}}})
    end
    
    def copy(unit_id, job_id, data = {})
      connection.get("#{resource_uri}/#{unit_id}/copy", {:query => {:unit => {:job_id => job_id, :data => data}}})
    end
    
    def split(on, with = " ")
      connection.get("#{resource_uri}/split", {:query => {:on => on, :with => with}})
    end
    
    def cancel(unit_id)
      connection.post("#{resource_uri}/#{unit_id}/cancel.json")
    end
  end
end
{'fraction_non_alphanumeric': 0.16574585635359115, 'fraction_numerical': 0.004249893752656183, 'mean_word_length': 2.471976401179941, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '625863', 'n_tokens_mistral': 810, 'n_tokens_neox': 777, 'n_words': 170}