<commit_before>module Godmin
  module Resource
    module Scopes
      extend ActiveSupport::Concern

      included do
        helper_method :scope_map
        helper_method :scope_count
      end

      def scope_map
        self.class.scope_map
      end

      def apply_scope(resources)
        params[:scope] = default_scope if params[:scope].blank?

        if params[:scope] && scope_map.key?(params[:scope].to_sym)
          send("scope_#{params[:scope]}", resources)
        else
          resources
        end
      end

      protected

      def scope_count(scope)
        apply_filters(
          send("scope_#{scope}", resources_relation)
        ).limit(nil).offset(nil).count
      end

      def default_scope
        scope = scope_map.find -> { scope_map.first } do |_key, value|
          value[:default] == true
        end

        scope ? scope[0].to_s : nil<commit_msg>We don't need to nil the limit and offset<commit_after>module Godmin
  module Resource
    module Scopes
      extend ActiveSupport::Concern

      included do
        helper_method :scope_map
        helper_method :scope_count
      end

      def scope_map
        self.class.scope_map
      end

      def apply_scope(resources)
        params[:scope] = default_scope if params[:scope].blank?

        if params[:scope] && scope_map.key?(params[:scope].to_sym)
          send("scope_#{params[:scope]}", resources)
        else
          resources
        end
      end

      protected

      def scope_count(scope)
        apply_filters(
          send("scope_#{scope}", resources_relation)
        ).count
      end

      def default_scope
        scope = scope_map.find -> { scope_map.first } do |_key, value|
          value[:default] == true
        end

        scope ? scope[0].to_s : nil
{'fraction_non_alphanumeric': 0.0897936419408812, 'fraction_numerical': 0.0011154489682097045, 'mean_word_length': 2.035532994923858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2859453', 'n_tokens_mistral': 511, 'n_tokens_neox': 497, 'n_words': 119}