<commit_before>module Jarvis
  module API
    class Addons
      def self.specs(type, name)
        Jarvis::Boot::Session.addons_sort_by_name[format(type, 's')][format(name)]
      end

      def self.client(name)
        infos = Jarvis::Boot::Session.addons_sort_by_name[:clients][format(name)]
        require "#{infos['directory']}/init"
        Object.const_get(infos['specs']['class_name'])
      end

      def self.call_receivers_for(service)
        Jarvis::Boot::Session.receivers_sort_by_services[service]
      end

      def self.format(word, suffix='')
        word = word.to_s
        word << suffix
        word.downcase.to_sym
      end
    end
  end
end<commit_msg>return empty array if nil<commit_after>module Jarvis
  module API
    class Addons
      def self.specs(type, name)
        Jarvis::Boot::Session.addons_sort_by_name[format(type, 's')][format(name)]
      end

      def self.client(name)
        infos = Jarvis::Boot::Session.addons_sort_by_name[:clients][format(name)]
        require "#{infos['directory']}/init"
        Object.const_get(infos['specs']['class_name'])
      end

      def self.call_receivers_for(*services)
        services.each do |service|
          receivers = Jarvis::Boot::Session.receivers_sort_by_services[service]
          return [] if receivers == nil
        end
      end

      def self.format(word, suffix='')
        word = word.to_s
        word << suffix
        word.downcase.to_sym
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11832319134550372, 'fraction_numerical': 0.0, 'mean_word_length': 2.7, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2326441', 'n_tokens_mistral': 479, 'n_tokens_neox': 475, 'n_words': 84}