<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#

from kubernetes.K8sPodBasedObject import K8sPodBasedObject
from kubernetes.models.v1.Pod import Pod
from kubernetes.models.v1.PodStatus import PodStatus
from kubernetes.K8sExceptions import NotFoundException
from kubernetes import K8sConfig


class K8sPod(K8sPodBasedObject):

    def __init__(self, config=None, name=None):
        K8sPodBasedObject.__init__(self, config=config, obj_type='Pod', name=name)
        self.model = Pod(name=name, namespace=self.config.namespace)

        if self.config.pull_secret is not None:
            self.model.add_image_pull_secrets(name=self.config.pull_secret)

    # -------------------------------------------------------------------------------------  add

    def add_annotation(self, k=None, v=None):
        self.model.add_pod_annotation(k=k, v=v)
        return self

    def add_label(self, k=None, v=None):
        self.model.add_pod_label(k=k, v=v)
        return self

    # ------------------------------------------------------------------------------------- delete
<commit_msg>K8sPod: ensure ObjectMeta and Spec are refreshed after create / update<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#

from kubernetes.K8sPodBasedObject import K8sPodBasedObject
from kubernetes.models.v1.Pod import Pod
from kubernetes.models.v1.PodStatus import PodStatus
from kubernetes.K8sExceptions import NotFoundException
from kubernetes import K8sConfig


class K8sPod(K8sPodBasedObject):

    def __init__(self, config=None, name=None):
        K8sPodBasedObject.__init__(self, config=config, obj_type='Pod', name=name)
        self.model = Pod(name=name, namespace=self.config.namespace)

        if self.config.pull_secret is not None:
            self.model.add_image_pull_secrets(name=self.config.pull_secret)

    # -------------------------------------------------------------------------------------  override

    def create(self):
        super(K8sPod, self).create()
        self.get()
        return self

    def update(self):
        super(K8sPod, self).update()
        self.get()
        return self

    # -------------------------------------------------------------------------------------  add

    def add_annotation(self, k=None, v=None):
        self.model.add_pod_annotation(k=k, v=v)
        return self

    def add_label(self, k=None, v=None):
        self.model.add_pod_label(k=k, v=v)
        return self

    # ------------------------------------------------------------------------------------- delete

{'fraction_non_alphanumeric': 0.23504273504273504, 'fraction_numerical': 0.00819088319088319, 'mean_word_length': 1.889917695473251, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1507892', 'n_tokens_mistral': 786, 'n_tokens_neox': 764, 'n_words': 188}