<commit_before># coding: utf-8

#* internal/action_pool.rb -- A managed hash of mysh actions.
module Mysh

  #* A managed hash of mysh actions.
  class ActionPool

    #The name of this action pool.
    attr_reader :pool_name

    #Create a new action pool
    def initialize(pool_name, &default_action)
      @pool_name, @pool = pool_name, {}
      @pool.default = default_action if default_action
    end

    #Get a action.
    def [](index)
      @pool[index]
    end

    #Add an action to the pool.
    def add_action(action)
      split_name = action.name.split[0] || ""

      if @pool.has_key?(split_name)
        fail "Add error: Action #{split_name.inspect} already exists in #{pool_name}."
      end

      @pool[split_name] = action
    end

    #Get information on all actions.
    def actions_info
      @pool
        .values<commit_msg>Removed silly code.<commit_after># coding: utf-8

#* internal/action_pool.rb -- A managed hash of mysh actions.
module Mysh

  #* A managed hash of mysh actions.
  class ActionPool

    #The name of this action pool.
    attr_reader :pool_name

    #Create a new action pool
    def initialize(pool_name, &default_action)
      @pool_name, @pool = pool_name, {}
      @pool.default = default_action
    end

    #Get a action.
    def [](index)
      @pool[index]
    end

    #Add an action to the pool.
    def add_action(action)
      split_name = action.name.split[0] || ""

      if @pool.has_key?(split_name)
        fail "Add error: Action #{split_name.inspect} already exists in #{pool_name}."
      end

      @pool[split_name] = action
    end

    #Get information on all actions.
    def actions_info
      @pool
        .values
{'fraction_non_alphanumeric': 0.09515366430260047, 'fraction_numerical': 0.002364066193853428, 'mean_word_length': 2.4979338842975207, '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': '646661', 'n_tokens_mistral': 548, 'n_tokens_neox': 533, 'n_words': 169}