<commit_before>require "fog"

module Vcloud
  module StartStop
    class Run
      def initialize(user, pass, host, org, status, vdc, opts = {})
        @org    = org
        @status = status.downcase
        @vapps  = vapps
        @vdc    = vdc
        @vapps  = opts[:vapps] ? opts[:vapps] : false
        @power_vdc = opts[:power_vdc] ? opts[:power_vdc] : false
        @vcloud = Fog::Compute::VcloudDirector.new(:vcloud_director_username => user,
                                                   :vcloud_director_password => <PASSWORD>,
                                                   :vcloud_director_host     => host)
      end

      def run
        org = @vcloud.organizations.get_by_name(@org)
        vdc = org.vdcz.get_by_name(@vdc)
       
        vapps.each { |vapp_sd| vdc.vapps.get_by_name(vapp_sd).power_off } if @vapps and @status.match('stop')
        vapps.each { |vapp_sd| vdc.vapps.get_by_name(vapp_sd).power_on } if @vapps and @status.match('start')
        
        vdc.power_off if @power_vdc and @status.match('stop')
        vdc_power_on if @power_vdc and not @status.match('start')
      end
    end 
  end
end<commit_msg>Adding more stuff<commit_after>require "fog"

module Vcloud
  module StartStop
    class Run
      def initialize(user, pass, host, org, status, vdc, opts = {})
        @org    = org
        @status = status.downcase
        @vdc    = vdc
        @vapps  = opts[:vapps] ? opts[:vapps] : false
        @power_vdc = opts[:power_vdc] ? opts[:power_vdc] : false
        @vcloud = Fog::Compute::VcloudDirector.new(:vcloud_director_username => user,
                                                   :vcloud_director_password => <PASSWORD>,
                                                   :vcloud_director_host     => host)
      end

      def run
        org = @vcloud.organizations.get_by_name(@org)
        vdc = org.vdcz.get_by_name(@vdc)
       
        vapps.each { |vapp_sd| vdc.vapps.get_by_name(vapp_sd).power_off } if @vapps and @status.match('stop')
        vapps.each { |vapp_sd| vdc.vapps.get_by_name(vapp_sd).power_on } if @vapps and @status.match('start')
        
        vdc.power_off if @power_vdc and @status.match('stop')
        vdc_power_on if @power_vdc and not @status.match('start')
      end
    end 
  end
end
{'fraction_non_alphanumeric': 0.11179039301310044, 'fraction_numerical': 0.0, 'mean_word_length': 1.9791937581274381, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3923302', 'n_tokens_mistral': 757, 'n_tokens_neox': 749, 'n_words': 149}