<commit_before>from traitsui.api import View, TreeEditor, TreeNode, Item, Tabbed
from simphony_metaparser import nodes

from .no_view import no_view

# Representation of the CUDS Items tree
cuds_editor = TreeEditor(
    nodes=[
        TreeNode(
            node_for=[nodes.CUDSItem],
            auto_open=True,
            children="children",
            label='name',
            view=no_view
        ),
    ],
    editable=True,
    selected='selected',
)


# Representation of the CUBA Data Types.
cuba_editor = TreeEditor(
    nodes=[
        TreeNode(
            node_for=[nodes.Ontology],
            auto_open=False,
            label='=CUBA Data Types',
            children="data_types",
            view=no_view
        ),
        TreeNode(
            node_for=[nodes.CUBADataType],
            auto_open=False,
            label='name',
            view=no_view
        ),
    ],
    editable=True,
    selected='selected',
    hide_root=True,
)


# The application view
app_view = View(
    Tabbed(
        Item(
            'object.ontology.root_cuds_item',
            editor=cuds_editor,
            resizable=True,
            show_label=False,
            label="CUDS Items"
        ),
        Item(
            'ontology',
            editor=cuba_editor,
            resizable=True,
            show_label=False,
            label="CUBA Data Types"
        ),
    ),
    title='Simphony Metadata',
    resizable=True,
    style='custom',
    width=1.0,
    height=1.0
)
<commit_msg>Added cuba data/cuds item visualizers<commit_after>from traitsui.api import View, TreeEditor, TreeNode, Item, Tabbed
from traitsui.group import VGroup

from simphony_metaedit.views.no_view import no_view
from simphony_metaparser import nodes


# Visualization of the CUDS Items internal data
cuds_item_view = View(
    VGroup(
        VGroup(
            Item("name", full_size=True),
            label="CUDS Item Data",
            show_border=True,
        ),
        VGroup(
            label="Fixed Properties",
            show_border=True,
        ),
        VGroup(
            label="Variable Properties",
            show_border=True,
        ),
    )
)

# Representation of the CUDS Items tree
cuds_editor = TreeEditor(
    nodes=[
        TreeNode(
            node_for=[nodes.CUDSItem],
            auto_open=True,
            children="children",
            label='name',
            view=cuds_item_view
        ),
    ],
    editable=True,
    selected='selected',
)

# Representation of the CUBA Data types
cuba_data_view = View(
    VGroup(
        Item("name"),
        Item("definition"),
        Item("type"),
        Item("shape"),
        Item("length"),
        label="CUBA Data Types",
        show_border=True
    )
)

# Representation of the CUBA Data Types.
cuba_editor = TreeEditor(
    nodes=[
        TreeNode(
            node_for=[nodes.Ontology],
            auto_open=False,
            label='=CUBA Data Types',
            children="data_types",
            view=no_view
        ),
        TreeNode(
            node_for=[nodes.CUBADataType],
            auto_open=False,
            label='name',
            view=cuba_data_view
        ),
    ],
    editable=True,
    selected='selected',
    hide_root=True,
)


# The application view
app_view = View(
    Tabbed(
        Item(
            'object.ontology.root_cuds_item',
            editor=cuds_editor,
            resizable=True,
            show_label=False,
            label="CUDS Items"
        ),
        Item(
            'ontology',
            editor=cuba_editor,
            resizable=True,
            show_label=False,
            label="CUBA Data Types"
        ),
    ),
    title='Simphony Metadata',
    resizable=True,
    style='custom',
    width=1.0,
    height=1.0
)

{'fraction_non_alphanumeric': 0.09904912836767037, 'fraction_numerical': 0.0021130480718436345, 'mean_word_length': 1.760204081632653, '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': '5507702', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1109, 'n_words': 221}