<commit_before>module Gtt

  require 'httparty'
  class Tracker

    attr_reader :token, :url

    def initialize(project, token, url='http://localhost:9393')
      @token = <PASSWORD>
      @url = "#{url}/projects/#{project}"
    end

    def start_day
      request(:put, "/days/#{date}", {start: time})
    end

    def end_day
      request(:put, "/days/#{date}", {end: time})
    end

    def commit_task(message, branch=nil)
      request(:post, "/days/#{date}/tasks", {
        message: message,
        type: :commit,
        branch: branch,
        time: time
      })
    end

    def start_task(message)
      request(:post, "/days/#{date}/tasks", {
        message: message,
        type: :task,
        time: time
      })
    end

    def pause_task
      request(:post, "/days/#{date}/breaks", {
        type: :pause,
        time: time
      })
    end

    def resume_task
      request(:post, "/days/#{date}/breaks", {
        type: :resume,
        time: time
      })
    end

    def stats
      request(:get, "/days/#{date}")
    end

    def logs(n=10)
      request(:get, '/logs', {limit: n})
    end

    private

    def request(method, path, params={})
      full_path = "#{url}#{path}/?token=#{token}"
      HTTParty.send(method, full_path, {body: params})
    end

    def date
      Time.now.strftime('%Y-%m-%d')
    end

    def time
      Time.now.strftime('%H:%M')
    end

  end

end
<commit_msg>Modify time params to be end<commit_after>module Gtt

  require 'httparty'
  class Tracker

    attr_reader :token, :url

    def initialize(project, token, url='http://localhost:9393')
      @token = token
      @url = "#{url}/projects/#{project}"
    end

    def start_day
      request(:put, "/days/#{date}", {start: time})
    end

    def end_day
      request(:put, "/days/#{date}", {end: time})
    end

    def commit_task(message, branch=nil)
      request(:post, "/days/#{date}/tasks", {
        message: message,
        type: :commit,
        branch: branch,
        end: time
      })
    end

    def start_task(message)
      request(:post, "/days/#{date}/tasks", {
        message: message,
        type: :task,
        end: time
      })
    end

    def pause_task
      request(:post, "/days/#{date}/breaks", {
        type: :pause,
        end: time
      })
    end

    def resume_task
      request(:post, "/days/#{date}/breaks", {
        type: :resume,
        end: time
      })
    end

    def stats
      request(:get, "/days/#{date}")
    end

    def logs(n=10)
      request(:get, '/logs', {limit: n})
    end

    private

    def request(method, path, params={})
      full_path = "#{url}#{path}/?token=#{token}"
      HTTParty.send(method, full_path, {body: params})
    end

    def date
      Time.now.strftime('%Y-%m-%d')
    end

    def time
      Time.now.strftime('%H:%M')
    end

  end

end

{'fraction_non_alphanumeric': 0.1584089323098395, 'fraction_numerical': 0.00418702023726448, 'mean_word_length': 2.0052410901467503, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2712378', 'n_tokens_mistral': 980, 'n_tokens_neox': 943, 'n_words': 223}