<commit_before>"""ContainerWidget class.  

Represents a container that can be used to group other widgets.
"""

# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

from .widget import DOMWidget
from IPython.utils.traitlets import Unicode, Tuple, TraitError

class ContainerWidget(DOMWidget):
    _view_name = Unicode('ContainerView', sync=True)

    # Child widgets in the container.
    # Using a tuple here to force reassignment to update the list.
    # When a proper notifying-list trait exists, that is what should be used here.
    children = Tuple(sync=True)

    def __init__(self, children = None, **kwargs):
        kwargs['children'] = children
        super(ContainerWidget, self).__init__(**kwargs)
        self.on_displayed(ContainerWidget._fire_children_displayed)

    def _fire_children_displayed(self):
        for child in self.children:
            child._handle_displayed()


class PopupWidget(ContainerWidget):
    _view_name = Unicode('PopupView', sync=True)
    
    description = Unicode(sync=True)
    button_text = Unicode(sync=True)<commit_msg>Container assumes the children attribute is not None<commit_after>"""ContainerWidget class.  

Represents a container that can be used to group other widgets.
"""

# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

from .widget import DOMWidget
from IPython.utils.traitlets import Unicode, Tuple, TraitError

class ContainerWidget(DOMWidget):
    _view_name = Unicode('ContainerView', sync=True)

    # Child widgets in the container.
    # Using a tuple here to force reassignment to update the list.
    # When a proper notifying-list trait exists, that is what should be used here.
    children = Tuple(sync=True, allow_none=False)

    def __init__(self, children = (), **kwargs):
        kwargs['children'] = children
        super(ContainerWidget, self).__init__(**kwargs)
        self.on_displayed(ContainerWidget._fire_children_displayed)

    def _fire_children_displayed(self):
        for child in self.children:
            child._handle_displayed()


class PopupWidget(ContainerWidget):
    _view_name = Unicode('PopupView', sync=True)
    
    description = Unicode(sync=True)
    button_text = Unicode(sync=True)
{'fraction_non_alphanumeric': 0.08431116905693177, 'fraction_numerical': 0.0, 'mean_word_length': 3.9719222462203025, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1675827', 'n_tokens_mistral': 646, 'n_tokens_neox': 625, 'n_words': 204}