<commit_before>import logging
import os
import socket
import uuid

from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils

from tendrl.commons import objects


LOG = logging.getLogger(__name__)


class ClusterNodeContext(objects.BaseObject):

    def __init__(self, machine_id=None, node_id=None, fqdn=None,
                 tags=None, status=None, *args, **kwargs):
        super(ClusterNodeContext, self).__init__(*args, **kwargs)
        self.value = 'clusters/%s/nodes/%s/NodeContext'
        self.machine_id = machine_id or NS.node_context.machine_id
        self.node_id = node_id or NS.node_context.node_id
        self.fqdn = fqdn or NS.node_context.fqdn
        self.tags = tags or NS.config.data['tags']
        self.status = status or "UP"
        self._etcd_cls = _ClusterNodeContextEtcd


class _ClusterNodeContextEtcd(EtcdObj):
    """A table of the node context, lazily updated

    """
    __name__ = 'clusters/%s/nodes/%s/NodeContext'
    _tendrl_cls = ClusterNodeContext

    def render(self):
        self.__name__ = self.__name__ % (NS.tendrl_context.integration_id,
                                         NS.node_context.node_id)
        return super(_ClusterNodeContextEtcd, self).render()<commit_msg>Update __init__.py<commit_after>import json
import logging
import os
import socket
import uuid

from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils

from tendrl.commons import objects


LOG = logging.getLogger(__name__)


class ClusterNodeContext(objects.BaseObject):

    def __init__(self, machine_id=None, node_id=None, fqdn=None,
                 tags=None, status=None, *args, **kwargs):
        super(ClusterNodeContext, self).__init__(*args, **kwargs)
        self.value = 'clusters/%s/nodes/%s/NodeContext'
        _node_context = NS.node_context.load()
        self.machine_id = machine_id or _node_context.machine_id
        self.node_id = node_id or _node_context.node_id
        self.fqdn = fqdn or _node_context.fqdn
        self.tags = tags or json.loads(_node_context.tags)
        self.status = status or _node_context.status
        self._etcd_cls = _ClusterNodeContextEtcd


class _ClusterNodeContextEtcd(EtcdObj):
    """A table of the node context, lazily updated

    """
    __name__ = 'clusters/%s/nodes/%s/NodeContext'
    _tendrl_cls = ClusterNodeContext

    def render(self):
        self.__name__ = self.__name__ % (NS.tendrl_context.integration_id,
                                         NS.node_context.node_id)
        return super(_ClusterNodeContextEtcd, self).render()
{'fraction_non_alphanumeric': 0.09252120277563608, 'fraction_numerical': 0.0, 'mean_word_length': 3.1321656050955413, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '10728', 'n_tokens_mistral': 817, 'n_tokens_neox': 793, 'n_words': 170}