<commit_before>module Harvest
  module API
    class Reports < Base
      
      def time_by_project(project, start_date, end_date, user = nil)
        query = {:from => start_date.strftime("%Y%m%d"), :to => end_date.strftime("%Y%m%d")}
        query[:user_id] = user.to_i if user
        
        response = request(:get, credentials, "/projects/#{project.to_i}/entries", :query => query)
        Harvest::TimeEntry.parse(massage_xml(response.body))
      end
      
      def time_by_user(user, start_date, end_date, project = nil)
        query = {:from => start_date.strftime("%Y%m%d"), :to => end_date.strftime("%Y%m%d")}
        query[:project_id] = project.to_i if project<commit_msg>add 'billable' param to reports.time_by_project and reports.time_by_user to add the billable=yes|no to the query<commit_after>module Harvest
  module API
    class Reports < Base
      
      def time_by_project(project, start_date, end_date, user = nil, billable = nil)
        query = {:from => start_date.strftime("%Y%m%d"), :to => end_date.strftime("%Y%m%d")}
        query[:user_id] = user.to_i if user
        query[:billable] = (billable ? "yes" : "no") unless billable.nil?
        
        response = request(:get, credentials, "/projects/#{project.to_i}/entries", :query => query)
        Harvest::TimeEntry.parse(massage_xml(response.body))
      end
      
      def time_by_user(user, start_date, end_date, project = nil, billable = nil)
        query = {:from => start_date.strftime("%Y%m%d"), :to => end_date.strftime("%Y%m%d")}
        query[:project_id] = project.to_i if project
        query[:billable] = (billable ? "yes" : "no") unless billable.nil?
{'fraction_non_alphanumeric': 0.1493076459963877, 'fraction_numerical': 0.0, 'mean_word_length': 3.305699481865285, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1750647', 'n_tokens_mistral': 569, 'n_tokens_neox': 549, 'n_words': 118}