<commit_before>module Gitlab
  module Kubernetes
    class Namespace
      attr_accessor :name

      def initialize(name, client)
        self.name = name
        @client = client
      end

      def exists?
        @client.get_namespace(name)
      rescue ::KubeException => ke
        raise ke unless ke.error_code == 404
        false
      end

      def create!
        resource = ::Kubeclient::Resource.new(metadata: { name: name })

        @client.create_namespace(resource)
      end

      def ensure_exists!
        exists? || create!
      end
    end
  end
end
<commit_msg>Review Gitlab::Kubernetes::Namespace<commit_after>module Gitlab
  module Kubernetes
    class Namespace
      attr_accessor :name

      def initialize(name, client)
        @name = name
        @client = client
      end

      def exists?
        @client.get_namespace(name)
      rescue ::KubeException => ke
        raise ke unless ke.error_code == 404
        false
      end

      def create!
        resource = ::Kubeclient::Resource.new(metadata: { name: name })

        @client.create_namespace(resource)
      end

      def ensure_exists!
        exists? || create!
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07866108786610879, 'fraction_numerical': 0.00502092050209205, 'mean_word_length': 1.9974937343358397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6419143', 'n_tokens_mistral': 347, 'n_tokens_neox': 330, 'n_words': 91}