<commit_before>module Fog
  module Compute
    class Brkt
      class Real
        def update_server_template(id, attributes)
          request(
            :expects => [202],
            :method  => "POST",
            :path    => "v1/api/config/instancetemplate/#{id}"
          )
        end
      end

      class Mock
        def update_server_template(id, attributes)
          server_template_data = self.data[:server_templates][id]
          server_template_data.merge!(Fog::StringifyKeys.stringify(attributes))
          Excon::Response.new(:body => server_template_data)
        end
      end
    end
  end
end
<commit_msg>Fix update for server templates<commit_after>module Fog
  module Compute
    class Brkt
      class Real
        def update_server_template(id, attributes)
          attributes[:image_definition] = attributes[:image_definition]["id"]
          request(
            :expects => [202],
            :method  => "POST",
            :path    => "v1/api/config/instancetemplate/#{id}",
            :body    => Fog::JSON.encode(attributes)
          )
        end
      end

      class Mock
        def update_server_template(id, attributes)
          server_template_data = self.data[:server_templates][id]
          server_template_data.merge!(Fog::StringifyKeys.stringify(attributes))
          Excon::Response.new(:body => server_template_data)
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09745762711864407, 'fraction_numerical': 0.005649717514124294, 'mean_word_length': 2.1280353200883004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '4551485', 'n_tokens_mistral': 402, 'n_tokens_neox': 395, 'n_words': 78}