<commit_before>require "ipaddr"

module Akashi
  class Vpc
    class Subnet
      class Base < Akashi::Vpc::Base
        def_delegators :@object, :availability_zone_name,
                                 :available_ip_address_count, :state, :vpc_id

        def cidr_block
          IPAddr.new(@object.cidr_block)
        end

        def route_table=(route_table)
          @object.route_table = route_table.id
          puts "A VPC (#{id}) associated with a RouteTable (#{route_table.id})."
        end

        class << self
          def all
            super.select { |subnet| base_cidr_block.include?(subnet.cidr_block) }
          end

          def create(vpc:, availability_zone:)
            response = Akashi::Aws.ec2.client.create_subnet(
              vpc_id:            vpc.id,
              availability_zone: availability_zone,
              cidr_block:        next_cidr_block(vpc: vpc).to_s + "/#{cidr}",
            )
            id = response[:subnet][:subnet_id]<commit_msg>Ooops! :scream_cat:<commit_after>require "ipaddr"

module Akashi
  class Vpc
    class Subnet
      class Base < Akashi::Vpc::Base
        def_delegators :@object, :availability_zone_name,
                                 :available_ip_address_count, :state, :vpc_id

        def cidr_block
          IPAddr.new(@object.cidr_block)
        end

        def route_table=(route_table)
          @object.route_table = route_table.id
          puts "A Subnet (#{id}) associated with a RouteTable (#{route_table.id})."
        end

        class << self
          def all
            super.select { |subnet| base_cidr_block.include?(subnet.cidr_block) }
          end

          def create(vpc:, availability_zone:)
            response = Akashi::Aws.ec2.client.create_subnet(
              vpc_id:            vpc.id,
              availability_zone: availability_zone,
              cidr_block:        next_cidr_block(vpc: vpc).to_s + "/#{cidr}",
            )
            id = response[:subnet][:subnet_id]
{'fraction_non_alphanumeric': 0.09764646970455683, 'fraction_numerical': 0.00100150225338007, 'mean_word_length': 1.8706896551724137, 'pattern_counts': {'":': 0, '<': 9, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2463242', 'n_tokens_mistral': 621, 'n_tokens_neox': 626, 'n_words': 116}