<commit_before>module Tanuki

  module MetaModelBehavior

      def initialize(namespace, name, data)
        @namespace = namespace
        @name = name
        @data = data
      end

      def class_name_for(class_type)
        case class_type
        when :model then "#{@namespace}_Model_#{@name}"
        when :model_base then "#{@namespace}_Model_#{@name}_#{@name}Base"
        when :manager then "#{@namespace}_Manager_#{@name}"
        when :manager_base then "#{@namespace}_Manager_#{@name}_#{@name}Base"
        end
      end

      def key
        if data['key'].nil?
          []
        elsif data['key'].is_a? Array
          data['key'].map {|item| qualified_name(item) }
        elsif data['key'].is_a? String
          [qualified_name(data['key'])]
        else
          raise "key for model #{@namespace}.#{@name} is invalid"
        end
      end

      def qualified_name(field_name)
        parts = field_name.split('.')
        if parts.length == 1
          ":#{field_name}"
        elsif parts.length == 2
          ":#{parts[1]}.qualify(:#{parts[0]}"
        else
          raise "field name for model #{@namespace}.#{@name} is invalid"
        end
      end

  end # end MetaModelBehavior

end # end Tanuki<commit_msg>Fixed missing instance variable sigil in meta model behavior<commit_after>module Tanuki

  module MetaModelBehavior

      def initialize(namespace, name, data)
        @namespace = namespace
        @name = name
        @data = data
      end

      def class_name_for(class_type)
        case class_type
        when :model then "#{@namespace}_Model_#{@name}"
        when :model_base then "#{@namespace}_Model_#{@name}_#{@name}Base"
        when :manager then "#{@namespace}_Manager_#{@name}"
        when :manager_base then "#{@namespace}_Manager_#{@name}_#{@name}Base"
        end
      end

      def key
        if @data['key'].nil?
          []
        elsif @data['key'].is_a? Array
          @data['key'].map {|item| qualified_name(item) }
        elsif @data['key'].is_a? String
          [qualified_name(@data['key'])]
        else
          raise "key for model #{@namespace}.#{@name} is invalid"
        end
      end

      def qualified_name(field_name)
        parts = field_name.split('.')
        if parts.length == 1
          ":#{field_name}"
        elsif parts.length == 2
          ":#{parts[1]}.qualify(:#{parts[0]}"
        else
          raise "field name for model #{@namespace}.#{@name} is invalid"
        end
      end

  end # end MetaModelBehavior

end # end Tanuki
{'fraction_non_alphanumeric': 0.1332547169811321, 'fraction_numerical': 0.0031446540880503146, 'mean_word_length': 2.2174462705436158, 'pattern_counts': {'":': 4, '<': 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': '4321226', 'n_tokens_mistral': 762, 'n_tokens_neox': 767, 'n_words': 187}