<commit_before>
module Nucleon
module Plugin
class Node < CORL.plugin_class(:base)
  
  include Celluloid
 
  #-----------------------------------------------------------------------------
  # Node plugin interface
   
  def normalize(reload)
    super
    
    export.each do |name, value|
      myself[name] = value
    end
    
    yield if block_given? # Chance to create a machine to feed hostname
    
    ui.resource = hostname
    logger      = hostname
    
    unless reload
      @cli_interface = Util::Liquid.new do |method, args, &code|
        result = exec({ :commands => [ [ method, args ].flatten.join(' ') ] }) do |op, data|
          code.call(op, data) if code
        end<commit_msg>Adding group initialization to the normalize method of the base node plugin.<commit_after>
module Nucleon
module Plugin
class Node < CORL.plugin_class(:base)
  
  include Celluloid
 
  #-----------------------------------------------------------------------------
  # Node plugin interface
   
  def normalize(reload)
    super
    
    export.each do |name, value|
      myself[name] = value
    end
    
    yield if block_given? # Chance to create a machine to feed hostname
    
    ui.resource = hostname
    logger      = hostname
    
    unless groups.include?("all")
      myself[:groups] = [ "all", groups ].flatten
    end
    
    unless reload
      @cli_interface = Util::Liquid.new do |method, args, &code|
        result = exec({ :commands => [ [ method, args ].flatten.join(' ') ] }) do |op, data|
          code.call(op, data) if code
        end
{'fraction_non_alphanumeric': 0.18558673469387754, 'fraction_numerical': 0.0, 'mean_word_length': 1.728695652173913, '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': '478988', 'n_tokens_mistral': 451, 'n_tokens_neox': 431, 'n_words': 137}