<commit_before>module Safemode
  class Blankslate
    @@allow_instance_methods = ['class', 'inspect', 'methods', 'respond_to?', 'to_s', 'instance_variable_get']
    @@allow_class_methods    = ['methods', 'new', 'name', 'inspect', '<', 'ancestors', '=='] # < needed in Rails Object#subclasses_of

    silently { undef_methods(*instance_methods - @@allow_instance_methods) }
    class << self
      silently { undef_methods(*instance_methods - @@allow_class_methods) }

      def method_added(name) end # ActiveSupport needs this

      def inherited(subclass)
        subclass.init_allowed_methods(@allowed_methods)
      end

      def init_allowed_methods(allowed_methods)
        @allowed_methods = allowed_methods
      end
<commit_msg>doc update<commit_after>module Safemode
  class Blankslate
    @@allow_instance_methods = ['class', 'inspect', 'methods', 'respond_to?', 'to_s', 'instance_variable_get']
    @@allow_class_methods    = ['methods', 'new', 'name', 'inspect', '<', 'ancestors', '==']
    # < needed in Rails Object#subclasses_of, ancestors and == is needed by rails/generate

    silently { undef_methods(*instance_methods - @@allow_instance_methods) }
    class << self
      silently { undef_methods(*instance_methods - @@allow_class_methods) }

      def method_added(name) end # ActiveSupport needs this

      def inherited(subclass)
        subclass.init_allowed_methods(@allowed_methods)
      end

      def init_allowed_methods(allowed_methods)
        @allowed_methods = allowed_methods
      end

{'fraction_non_alphanumeric': 0.1180327868852459, 'fraction_numerical': 0.0, 'mean_word_length': 4.226027397260274, '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': '3741899', 'n_tokens_mistral': 463, 'n_tokens_neox': 441, 'n_words': 95}