<commit_before>module Fog
  module Parsers
    module Compute
      module AWS
        class DescribeInternetGateways < Fog::Parsers::Base
          def reset
            @internet_gateway = { 'attachmentSet' => {}, 'tagSet' => {} }
            @response = { 'internetGatewaySet' => [] }
            @tag = {}
            @attachment = {}
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'tagSet'
              @in_tag_set = true
            when 'attachmentSet'
              @in_attachment_set = true
            end
          end

          def end_element(name)
            if @in_tag_set
              case name
                when 'item'
                  @internet_gateway['tagSet'][@tag['key']] = @tag['value']
                  @tag = {}
                when 'key', 'value'
                  @tag[name] = value
                when 'tagSet'
                  @in_tag_set = false
              end
            elsif @in_attachment_set
              case name
                when 'item'
                  @internet_gateway['attachmentSet']=@attachment
                  @attachment = {}
                when 'vpcId', 'state'
                  @attachment[name] = value
                when 'attachmentSet'
                  @in_attachment_set = false
              end
            else
              case name
              when 'internetGatewayId'
                @internet_gateway[name] = value
              when 'item'
                @response['internetGatewaySet'] << @internet_gateway
                @internet_gateway = { 'tagSet' => {} }
                @internet_gateway = { 'attachmentSet' => {} }
              when 'requestId'
                @response[name] = value
              end
            end
          end
        end
      end
    end
  end
end<commit_msg>Fix describe_internet_gateways calls for >1 igw<commit_after>module Fog
  module Parsers
    module Compute
      module AWS
        class DescribeInternetGateways < Fog::Parsers::Base
          def reset
            @internet_gateway = { 'attachmentSet' => {}, 'tagSet' => {} }
            @response = { 'internetGatewaySet' => [] }
            @tag = {}
            @attachment = {}
          end

          def start_element(name, attrs = [])
            super
            case name
            when 'tagSet'
              @in_tag_set = true
            when 'attachmentSet'
              @in_attachment_set = true
            end
          end

          def end_element(name)
            if @in_tag_set
              case name
                when 'item'
                  @internet_gateway['tagSet'][@tag['key']] = @tag['value']
                  @tag = {}
                when 'key', 'value'
                  @tag[name] = value
                when 'tagSet'
                  @in_tag_set = false
              end
            elsif @in_attachment_set
              case name
                when 'item'
                  @internet_gateway['attachmentSet']=@attachment
                  @attachment = {}
                when 'vpcId', 'state'
                  @attachment[name] = value
                when 'attachmentSet'
                  @in_attachment_set = false
              end
            else
              case name
              when 'internetGatewayId'
                @internet_gateway[name] = value
              when 'item'
                @response['internetGatewaySet'] << @internet_gateway
                @internet_gateway = { 'attachmentSet' => {}, 'tagSet' => {} }
              when 'requestId'
                @response[name] = value
              end
            end
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08897276894041521, 'fraction_numerical': 0.00026961445133459155, 'mean_word_length': 1.132183908045977, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, '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': '3432591', 'n_tokens_mistral': 964, 'n_tokens_neox': 928, 'n_words': 209}