<commit_before>from __future__ import absolute_import

from widgy.site import WidgySite
from widgy.contrib.page_builder.models import Accordion, Section
from widgy.contrib.widgy_i18n.models import I18NLayout
from widgy import registry

from demo.demo_widgets.models import TwoContentLayout


class DemoWidgySite(WidgySite):
    def valid_parent_of(self, parent, child_class, obj=None):
        if isinstance(parent, I18NLayout):
            return True
        else:
            return super(DemoWidgySite, self).valid_parent_of(parent, child_class, obj)

widgy_site = DemoWidgySite()
<commit_msg>Fix the demo widgy site based on 448fc923ba<commit_after>from __future__ import absolute_import

from widgy.site import WidgySite


class DemoWidgySite(WidgySite):
    def valid_parent_of(self, parent, child_class, obj=None):
        if isinstance(parent, I18NLayout):
            return True
        else:
            return super(DemoWidgySite, self).valid_parent_of(parent, child_class, obj)

widgy_site = DemoWidgySite()

from widgy.contrib.widgy_i18n.models import I18NLayout

{'fraction_non_alphanumeric': 0.06679035250463822, 'fraction_numerical': 0.016697588126159554, 'mean_word_length': 4.395, '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': '2040518', 'n_tokens_mistral': 359, 'n_tokens_neox': 341, 'n_words': 84}