<commit_before>require "English"
require "tempfile"
require "svn/error"
require "svn/util"
require "svn/core"
require "svn/repos"
require "svn/ext/ra"

module Svn
  module Ra
    Util.set_constants(Ext::Ra, self)
    Util.set_methods(Ext::Ra, self)

    @@ra_pool = Svn::Core::Pool.new
    Ra.initialize(@@ra_pool)

    class << self
      def modules
        print_modules("")
      end
    end

    Session = SWIG::TYPE_p_svn_ra_session_t

    class Session
      class << self
        def open(url, config={}, callbacks=nil)
          Ra.open2(url, callbacks, config)
        end
      end

      def latest_revnum
        Ra.get_latest_revnum(self)
      end

      def dated_revision(time)
        Ra.get_dated_revision(self, time.to_apr_time)
      end

      def set_prop(name, value, rev=nil)
        Ra.change_rev_prop(self, rev || latest_revnum, name, value)
      end

      def []=(name, *args)
        value = args.pop
        set_prop(name, value, *args)
        value
      end

      def proplist(rev=nil)
        Ra.rev_proplist(self, rev || latest_revnum)
      end
      alias properties proplist

      def prop(name, rev=nil)
        Ra.rev_prop(self, rev || latest_revnum, name)
      end<commit_msg>Improve API.<commit_after>require "English"
require "tempfile"
require "svn/error"
require "svn/util"
require "svn/core"
require "svn/repos"
require "svn/ext/ra"

module Svn
  module Ra
    Util.set_constants(Ext::Ra, self)
    Util.set_methods(Ext::Ra, self)

    @@ra_pool = Svn::Core::Pool.new
    Ra.initialize(@@ra_pool)

    class << self
      def modules
        print_modules("")
      end
    end

    Session = SWIG::TYPE_p_svn_ra_session_t

    class Session
      class << self
        def open(url, config={}, callbacks=nil)
          Ra.open2(url, callbacks, config)
        end
      end

      def latest_revnum
        Ra.get_latest_revnum(self)
      end
      alias latest_revision latest_revnum

      def dated_revision(time)
        Ra.get_dated_revision(self, time.to_apr_time)
      end

      def set_prop(name, value, rev=nil)
        Ra.change_rev_prop(self, rev || latest_revnum, name, value)
      end

      def []=(name, *args)
        value = args.pop
        set_prop(name, value, *args)
        value
      end

      def proplist(rev=nil)
        Ra.rev_proplist(self, rev || latest_revnum)
      end
      alias properties proplist

      def prop(name, rev=nil)
        Ra.rev_prop(self, rev || latest_revnum, name)
      end
{'fraction_non_alphanumeric': 0.10422535211267606, 'fraction_numerical': 0.0008048289738430583, 'mean_word_length': 2.368563685636856, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6425416', 'n_tokens_mistral': 875, 'n_tokens_neox': 841, 'n_words': 189}