<commit_before>'''
Manage the job tree
'''

# Import third party libs
import urwid


class JIDWidget(urwid.TreeWidget):
    '''
    Manage the display of the job return data
    '''
    def get_display_text(self):
        return 'Widget'


class JIDNode(urwid.TreeNode):
    '''
    Manage the Minion layer
    '''
    def load_widget(self):
        return JIDWidget(self)


class JIDParent(urwid.ParentNode):
    '''
    '''
    def load_widget(self):
        return JIDWidget(self)

    def load_child_keys(self):
        return [1, 2, 3]

    def load_child_node(self, key):
        return JIDNode('node', parent=self, key=key)


class JIDView(object):
    def __init__(self):
        self.treetop = JIDParent({})
        self.listbox = urwid.TreeListBox(urwid.TreeWalker(self.treetop))
        self.listbox.offset_rows = 1<commit_msg>Start shaping up data interpretation for tree<commit_after>'''
Manage the job tree
'''

# Import third party libs
import urwid


class JIDWidget(urwid.TreeWidget):
    '''
    Manage the display of the job return data
    '''
    def get_display_text(self):
        return 'Job ID'


class JIDNode(urwid.TreeNode):
    '''
    Manage the Minion layer
    '''
    def load_widget(self):
        return JIDWidget(self)


class JIDParent(urwid.ParentNode):
    '''
    '''
    def load_widget(self):
        return JIDWidget(self)

    def load_child_keys(self):
        data = self.get_value()
        return range(len(data))

    def load_child_node(self, key):
        value = self.get_value()
        if 'jids' in value:
            data = value['jids'][key]
            childclass = JIDParent
        if 'minions' in value:
            data = value['minions'][key]
            childclass = JIDParent
        else:
            data = value
            childclass = JIDNode
        return childclass(data, parent=self, key=key)


class JIDView(object):
    def __init__(self):
        self.treetop = JIDParent({})
        self.listbox = urwid.TreeListBox(urwid.TreeWalker(self.treetop))
        self.listbox.offset_rows = 1
{'fraction_non_alphanumeric': 0.1101407083939835, 'fraction_numerical': 0.0024260067928190197, 'mean_word_length': 2.5368782161234993, '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': '5588799', 'n_tokens_mistral': 674, 'n_tokens_neox': 656, 'n_words': 157}