<commit_before>#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" A viewer for tabular data. """


# Major package imports.
import wx

# Enthought library imports.
from enthought.pyface.image_list import ImageList
from enthought.traits.api import Color, Event, Instance, Trait

# Local imports.
from content_viewer import ContentViewer
from table_column_provider import TableColumnProvider
from table_content_provider import TableContentProvider
from table_label_provider import TableLabelProvider


class TableViewer(ContentViewer):
    """ A viewer for tabular data. """


    # The content provider provides the actual table data.
    content_provider = Instance(TableContentProvider)

    # The label provider provides, err, the labels for the items in the table
    # (a label can have text and/or an image).
    label_provider = Trait(TableLabelProvider(), Instance(TableLabelProvider))

    # The column provider provides information about the columns in the table
    # (column headers, width etc).
    column_provider=Trait(TableColumnProvider(),Instance(TableColumnProvider))
<commit_msg>modernized the use of Instance with a default. No longer leaks references<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought pyface package component>
#------------------------------------------------------------------------------
""" A viewer for tabular data. """


# Major package imports.
import wx

# Enthought library imports.
from enthought.pyface.image_list import ImageList
from enthought.traits.api import Color, Event, Instance, Trait

# Local imports.
from content_viewer import ContentViewer
from table_column_provider import TableColumnProvider
from table_content_provider import TableContentProvider
from table_label_provider import TableLabelProvider


class TableViewer(ContentViewer):
    """ A viewer for tabular data. """


    # The content provider provides the actual table data.
    content_provider = Instance(TableContentProvider)

    # The label provider provides, err, the labels for the items in the table
    # (a label can have text and/or an image).
    label_provider = Instance(TableLabelProvider, factory = TableLabelProvider)

    # The column provider provides information about the columns in the table
    # (column headers, width etc).
    column_provider=Trait(TableColumnProvider(),Instance(TableColumnProvider))

{'fraction_non_alphanumeric': 0.1508558166521613, 'fraction_numerical': 0.0023208587177255585, 'mean_word_length': 3.0708382526564346, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5381467', 'n_tokens_mistral': 835, 'n_tokens_neox': 795, 'n_words': 330}