<commit_before>module ContainerChecks
  def containers_check_and_act
    
    services_status = get_services_status
   results = check_and_act(services_status, 'service')
    engines_status = get_engines_status
    results!.merge(check_and_act(engines_status, 'container'))
      results
  end
  protected
  def check_and_act(containers_status, ctype)
    result = {}
    containers_status.keys.each do |container_name|
      if containers_status[container_name]['error'] == true
      result[container_name] = act_on(result[container_name], ctype)
    else
        result[container_name] = 'ok'
     end       
    end
  end
  
  def act_on(container_name, ctype)
    return 'fail'
  end
end<commit_msg>! in wrong spot<commit_after>module ContainerChecks
  def containers_check_and_act
    
    services_status = get_services_status
   results = check_and_act(services_status, 'service')
    engines_status = get_engines_status
    results.merge!(check_and_act(engines_status, 'container'))
      results
  end
  protected
  def check_and_act(containers_status, ctype)
    result = {}
    containers_status.keys.each do |container_name|
      if containers_status[container_name]['error'] == true
      result[container_name] = act_on(result[container_name], ctype)
    else
        result[container_name] = 'ok'
     end       
    end
  end
  
  def act_on(container_name, ctype)
    return 'fail'
  end
end
{'fraction_non_alphanumeric': 0.08014184397163121, 'fraction_numerical': 0.0, 'mean_word_length': 3.7348993288590604, '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': '2976833', 'n_tokens_mistral': 443, 'n_tokens_neox': 445, 'n_words': 86}