<commit_before>require File.dirname(__FILE__) + "/display"

module PoolParty
  module Console
    
    include Display
    
    # Load a file that contains a pool into memory
    def load_pool(filename)

      unless filename && ::File.readable?(filename)
        puts "Please specify your cloud with -s, move it to ./pool.spec or in your POOL_SPEC environment variable"
        exit(1)
      else
        PoolParty::Script.inflate(open(filename).read, filename)
      end
    end
    
    def extract_cloud_from_options(o)
      o.cloudname ? [cloud(o.cloudname.downcase.to_sym)] : [clouds[clouds.keys.sort.first]]
    end
    
    def extract_pool_from_options(o)
      o.poolname ? [pool(o.poolname.downcase.to_sym)] : [pools[pools.keys.sort.first]]
    end
    
    # Clear all the pools and reload the console
    # Call within console to reset and reload the entire poolparty base
    # as well
    def reload!      
      reset!<commit_msg>Updated gem with security groups<commit_after>require File.dirname(__FILE__) + "/display"

module PoolParty
  module Console
    
    include Display
    
    # Load a file that contains a pool into memory
    def load_pool(filename)

      unless filename && ::File.readable?(filename)
        puts "Please specify your cloud with -s, move it to ./pool.spec or in your POOL_SPEC environment variable"
        exit(1)
      else
        PoolParty::Script.inflate(open(filename).read, filename)
      end
    end
    
    def extract_cloud_from_options(o)
      o.cloudname ? [cloud(o.cloudname.downcase.to_sym)] : clouds.collect {|n,cl| cl}
    end
    
    def extract_pool_from_options(o)
      o.poolname ? [pool(o.poolname.downcase.to_sym)] : pools.collect {|n,pl| pl}
    end
    
    # Clear all the pools and reload the console
    # Call within console to reset and reload the entire poolparty base
    # as well
    def reload!      
      reset!
{'fraction_non_alphanumeric': 0.08517350157728706, 'fraction_numerical': 0.0010515247108307045, 'mean_word_length': 2.6666666666666665, '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': '906031', 'n_tokens_mistral': 584, 'n_tokens_neox': 568, 'n_words': 171}