<commit_before>class Alchemia
  module Plugins
    class Base

      def process
        nil
      end

      def selectors(tree)
        selectors = []
        tree.each do |t|
          if is_rule(t)
            selectors.push t[:selector][:tokens][1][:raw]
            selectors.push t[:selector][:value]
          end
        end
        selectors
      end

      def properties(tree, selector)
        properties = []
        tree.each do |t|
          if is_rule(t)
            t[:children].each do |child|
              if is_property(child)
                properties.push child[:name]
              end
            end
          end
        end
        ptoperties
      end


      private

      def is_rule(node)
        true if node[:node] == :style_rule
      end

      def is_property(node)
        true if node[:property] == :property
      end

    end
  end
end
<commit_msg>Fix Alchemia::Plugins::Base<commit_after>class Alchemia
  module Plugins
    class Base

      def initialize(tree)
        @tree = tree
      end

      def process
        nil
      end

      def all_selectors
        selectors = []
        @tree.each do |t|
          if is_rule(t)
            selectors.push t[:selector][:value]
          end
        end
        selectors
      end

      def selector(selector)
        @tree.each do |t|
          if is_rule(t)
            if selector == t[:selector][:value]
              return t[:selector][:tokens][1][:raw]
            end
          end
        end
      end

      def all_properties(selector)
        properties = []
        @tree.each do |t|
          if is_rule(t)
            t[:children].each do |child|
              if is_property(child)
                properties.push child[:name]
              end
            end
          end
        end
        ptoperties
      end


      private

      def is_rule(node)
        true if node[:node] == :style_rule
      end

      def is_property(node)
        true if node[:property] == :property
      end

      def is_child(child)
        true if child[:node] == :property
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.08151658767772511, 'fraction_numerical': 0.0009478672985781991, 'mean_word_length': 1.307103825136612, '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': '3074578', 'n_tokens_mistral': 615, 'n_tokens_neox': 590, 'n_words': 158}