<commit_before>namespace :cs do

  namespace :get do

    # rake cs:get:path[locationauthorities]
    desc "GET request by path"
    task :path, [:path, :format, :params] do |t, args|
      path   = args[:path]
      format = (args[:format] || 'json').to_sym
      params = Csible::HTTP.convert_params(args[:params]  || '')
      get    = Csible::HTTP::Get.new($client, $log)
      begin
        get.execute :path, path, params
        get.print format
      rescue Exception => ex
        $log.error ex.message
      end
    end

    # rake cs:get:url[https://cspace.lyrasistechnology.org/cspace-services/locationauthorities]
    desc "GET request by url"
    task :url, [:url, :format, :params] do |t, args|
      url    = args[:url]
      format = (args[:format] || 'json').to_sym
      params = Csible::HTTP.convert_params(args[:params]  || '')
      get    = Csible::HTTP::Get.new($client, $log)
      begin
        get.execute :url, url, params
        get.print format
      rescue Exception => ex
        $log.error ex.message
      end

    end

    # rake cs:get:list[media,"wf_deleted=false&pgSz=100"]
    desc "GET request by path for results list to csv specifying properties"
    task :list, [:path, :params, :output] do |t, args|
      path       = args[:path]
      params     = Csible::HTTP.convert_params(args[:params]  || '')
      output     = args[:output] || "response.csv"
      get        = Csible::HTTP::Get.new($client, $log)
      results    = get.list path, params
      File.open(output, "w")
      Csible.write_csv(output, results, $log) unless results.empty?
    end

  end

end<commit_msg>Print output file for list response<commit_after>namespace :cs do

  namespace :get do

    # rake cs:get:path[locationauthorities]
    desc "GET request by path"
    task :path, [:path, :format, :params] do |t, args|
      path   = args[:path]
      format = (args[:format] || 'json').to_sym
      params = Csible::HTTP.convert_params(args[:params]  || '')
      get    = Csible::HTTP::Get.new($client, $log)
      begin
        get.execute :path, path, params
        get.print format
      rescue Exception => ex
        $log.error ex.message
      end
    end

    # rake cs:get:url[https://cspace.lyrasistechnology.org/cspace-services/locationauthorities]
    desc "GET request by url"
    task :url, [:url, :format, :params] do |t, args|
      url    = args[:url]
      format = (args[:format] || 'json').to_sym
      params = Csible::HTTP.convert_params(args[:params]  || '')
      get    = Csible::HTTP::Get.new($client, $log)
      begin
        get.execute :url, url, params
        get.print format
      rescue Exception => ex
        $log.error ex.message
      end

    end

    # rake cs:get:list[media,"wf_deleted=false&pgSz=100"]
    desc "GET request by path for results list to csv specifying properties"
    task :list, [:path, :params, :output] do |t, args|
      path       = args[:path]
      params     = Csible::HTTP.convert_params(args[:params]  || '')
      output     = args[:output] || "response.csv"
      message    = "List output for #{path} was written to #{output}"
      get        = Csible::HTTP::Get.new($client, $log)
      results    = get.list path, params
      if results.any?
        File.open(output, "w")
        Csible.write_csv(output, results, $log)
      else
        message = "No records found for #{path}"
      end
      $log.info message
      puts message
    end

  end

end
{'fraction_non_alphanumeric': 0.13706172124022023, 'fraction_numerical': 0.0017386264850767893, 'mean_word_length': 2.4833501513622602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3901483', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1091, 'n_words': 285}