<commit_before>module DataMapper
  module Relation
    class Aliases

      class AttributeIndex

        # Build a new {AttributeIndex} instance
        #
        # @param [Symbol] relation_name
        #   the name of the relation
        #
        # @param [AttributeSet] attribute_set
        #   the set of attributes to build the index for
        #
        # @param [Class] strategy_class
        #   the strategy class to use for joining
        #
        # @return [AttributeIndex]
        #
        # @api private
        def self.build(relation_name, attribute_set, strategy_class)
          new(initial_entries(relation_name, attribute_set), strategy_class)
        end

        # Return index entries as required by {Aliases#initialize}
        #
        # @param [#to_sym] relation_name
        #   the name of the relation +attribute_set+ belongs to
        #
        # @param [DataMapper::Mapper::AttributeSet] attribute_set
        #   the attribute set to be aliased
        #
        # @return [Hash<Attribute, Attribute>]
        #
        # @api private
        def self.initial_entries(relation_name, attribute_set)
          attribute_set.primitives.each_with_object({}) { |attribute, entries|
            attribute = Attribute.build(attribute.field, relation_name)
            entries[attribute] = attribute
          }
        end
<commit_msg>Rename local variable to not shadow a block parameter<commit_after>module DataMapper
  module Relation
    class Aliases

      class AttributeIndex

        # Build a new {AttributeIndex} instance
        #
        # @param [Symbol] relation_name
        #   the name of the relation
        #
        # @param [AttributeSet] attribute_set
        #   the set of attributes to build the index for
        #
        # @param [Class] strategy_class
        #   the strategy class to use for joining
        #
        # @return [AttributeIndex]
        #
        # @api private
        def self.build(relation_name, attribute_set, strategy_class)
          new(initial_entries(relation_name, attribute_set), strategy_class)
        end

        # Return index entries as required by {Aliases#initialize}
        #
        # @param [#to_sym] relation_name
        #   the name of the relation +attribute_set+ belongs to
        #
        # @param [DataMapper::Mapper::AttributeSet] attribute_set
        #   the attribute set to be aliased
        #
        # @return [Hash<Attribute, Attribute>]
        #
        # @api private
        def self.initial_entries(relation_name, attribute_set)
          attribute_set.primitives.each_with_object({}) { |attribute, entries|
            entry = Attribute.build(attribute.field, relation_name)
            entries[entry] = entry
          }
        end

{'fraction_non_alphanumeric': 0.07308248914616498, 'fraction_numerical': 0.0, 'mean_word_length': 2.0756395995550614, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7481718', 'n_tokens_mistral': 718, 'n_tokens_neox': 705, 'n_words': 206}