<commit_before>module ActiveRecordAnonymizer
  module PostgreSQL
    module PgTools
      extend self

      def search_path
        ActiveRecord::Base.connection.schema_search_path
      end

      def default_search_path
        @default_search_path ||= %{"$user", public}
      end

      def set_anonymized_search_path(name=ActiveRecordAnonymizer::Anonymizer.default_schema_name)
        path_parts = [name.to_s, "public"]
        ActiveRecord::Base.connection.schema_search_path = path_parts.join(",")
      end

      def restore_default_search_path
        ActiveRecord::Base.connection.schema_search_path = default_search_path
      end
    end
  end
end<commit_msg>Checking to see if connection adaptor responds to schema_search_path<commit_after>module ActiveRecordAnonymizer
  module PostgreSQL
    module PgTools
      extend self

      def search_path
        ActiveRecord::Base.connection.schema_search_path
      end

      def default_search_path
        @default_search_path ||= %{"$user", public}
      end

      def set_anonymized_search_path(name=ActiveRecordAnonymizer::Anonymizer.default_schema_name)
        if ActiveRecord::Base.connection.respond_to?(:schema_search_path=)
          path_parts = [name.to_s, "public"]
          ActiveRecord::Base.connection.schema_search_path = path_parts.join(",")
        end
      end

      def restore_default_search_path
        ActiveRecord::Base.connection.schema_search_path = default_search_path if ActiveRecord::Base.connection.respond_to?(:schema_search_path=)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07174887892376682, 'fraction_numerical': 0.0, 'mean_word_length': 3.462857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6954969', 'n_tokens_mistral': 457, 'n_tokens_neox': 449, 'n_words': 80}