<commit_before>module Fog
  module Network
    class OpenStack
      class Real
        def create_floating_ip(floating_network_id, options = {})
          data = {
            'floatingip' => {
              'floating_network_id' => floating_network_id
            }
          }

          vanilla_options = [:port_id, :tenant_id, :fixed_ip_address, :floating_ip_address]
          vanilla_options.reject { |o| options[o].nil? }.each do |key|
            data['floatingip'][key] = options[key]
          end

          request(
            :body    => Fog::JSON.encode(data),
            :expects => [201],
            :method  => 'POST',
            :path    => 'floatingips'
          )
        end<commit_msg>allow subnet id parameter on floating ip allocation (#251)<commit_after>module Fog
  module Network
    class OpenStack
      class Real
        def create_floating_ip(floating_network_id, options = {})
          data = {
            'floatingip' => {
              'floating_network_id' => floating_network_id
            }
          }

          vanilla_options = [:port_id, :tenant_id, :fixed_ip_address, :floating_ip_address, :subnet_id]
          vanilla_options.reject { |o| options[o].nil? }.each do |key|
            data['floatingip'][key] = options[key]
          end

          request(
            :body    => Fog::JSON.encode(data),
            :expects => [201],
            :method  => 'POST',
            :path    => 'floatingips'
          )
        end
{'fraction_non_alphanumeric': 0.11260957518543493, 'fraction_numerical': 0.006068779501011463, 'mean_word_length': 1.758364312267658, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2010761', 'n_tokens_mistral': 463, 'n_tokens_neox': 442, 'n_words': 86}