<commit_before>module Hdo
  module StortingImporter
    class ApiDataSource < DataSource
      USER_AGENT = "holderdeord-storting-importer"

      def initialize(url)
        @resource = RestClient::Resource.new(URI.parse(url), )
      end

      def representatives(period = DEFAULT_PERIOD)
        fetch "eksport/representanter/?StortingsPeriodeId=#{period}"
      end

      def representatives_today
        fetch 'eksport/dagensrepresentanter/'
      end

      def parties(session_id = DEFAULT_SESSION)
        fetch "eksport/partier/?sesjonid=#{session_id}"
      end

      def committees(session_id = DEFAULT_SESSION)
        fetch "eksport/komiteer/?SesjonId=#{session_id}"
      end

      def districts
        fetch "eksport/fylker"
      end

      def categories
        fetch "eksport/emner"<commit_msg>Add ApiDataSource.default<commit_after>module Hdo
  module StortingImporter
    class ApiDataSource < DataSource
      USER_AGENT = "holderdeord-storting-importer"

      def self.default
        new "http://data.stortinget.no"
      end

      def initialize(url)
        @resource = RestClient::Resource.new(URI.parse(url), )
      end

      def representatives(period = DEFAULT_PERIOD)
        fetch "eksport/representanter/?StortingsPeriodeId=#{period}"
      end

      def representatives_today
        fetch 'eksport/dagensrepresentanter/'
      end

      def parties(session_id = DEFAULT_SESSION)
        fetch "eksport/partier/?sesjonid=#{session_id}"
      end

      def committees(session_id = DEFAULT_SESSION)
        fetch "eksport/komiteer/?SesjonId=#{session_id}"
      end

      def districts
        fetch "eksport/fylker"
      end

      def categories
        fetch "eksport/emner"
{'fraction_non_alphanumeric': 0.08410672853828306, 'fraction_numerical': 0.0, 'mean_word_length': 2.6546610169491527, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2130320', 'n_tokens_mistral': 536, 'n_tokens_neox': 504, 'n_words': 97}