<commit_before>module Neo4j
  # To contain any base login for ActiveNode/ActiveRel which
  # is external to the main classes
  module ActiveBase
    class << self
      # private?
      def current_session
        SessionRegistry.current_session.tap do |session|
          fail 'No session defined!' if session.nil?
        end
      end

      def current_transaction_or_session
        current_transaction || current_session
      end

      def query(*args)
        current_transaction_or_session.query(*args)
      end

      # Should support setting session via config options
      def current_session=(session)
        SessionRegistry.current_session = session
      end

      def current_adaptor=(adaptor)
        current_session = Neo4j::Core::CypherSession.new(adaptor)
      end

      def run_transaction(run_in_tx = true)
        Neo4j::Transaction.run(current_session, run_in_tx) do |tx|
          yield tx
        end
      end

      def new_transaction
        Neo4j::Transaction.new(current_session)
      end

      def new_query(options = {})
        Neo4j::Core::Query.new({session: current_session}.merge(options))
      end

      def current_transaction
        Neo4j::Transaction.current_for(current_session)
      end
    end
  end
end
<commit_msg>Rubocop: Style/AccessorMethodName<commit_after>module Neo4j
  # To contain any base login for ActiveNode/ActiveRel which
  # is external to the main classes
  module ActiveBase
    class << self
      # private?
      def current_session
        SessionRegistry.current_session.tap do |session|
          fail 'No session defined!' if session.nil?
        end
      end

      def current_transaction_or_session
        current_transaction || current_session
      end

      def query(*args)
        current_transaction_or_session.query(*args)
      end

      # Should support setting session via config options
      def current_session=(session)
        SessionRegistry.current_session = session
      end

      def current_adaptor=(adaptor)
        self.current_session = Neo4j::Core::CypherSession.new(adaptor)
      end

      def run_transaction(run_in_tx = true)
        Neo4j::Transaction.run(current_session, run_in_tx) do |tx|
          yield tx
        end
      end

      def new_transaction
        Neo4j::Transaction.new(current_session)
      end

      def new_query(options = {})
        Neo4j::Core::Query.new({session: current_session}.merge(options))
      end

      def current_transaction
        Neo4j::Transaction.current_for(current_session)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06640776699029126, 'fraction_numerical': 0.004660194174757282, 'mean_word_length': 2.5384615384615383, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7523795', 'n_tokens_mistral': 738, 'n_tokens_neox': 710, 'n_words': 175}