<commit_before>from django import dispatch
from django.db import transaction
from django.db.models import signals as model_signals

from . import client
from .pool import pool
from resolwe.flow import models as flow_models, serializers as flow_serializers, views as flow_views

# Register all viewsets with the query observer pool.
# TODO: This should be moved to a separate application.
pool.register_viewset(flow_views.CollectionViewSet)
pool.register_viewset(flow_views.DataViewSet)

# Setup model notifications.
observer_client = client.QueryObserverClient()


@dispatch.receiver(model_signals.post_save)
def model_post_save(sender, instance, created=False, **kwargs):
    """
    Signal emitted after any model is saved via Django ORM.<commit_msg>Register Process viewset for query observers.<commit_after>from django import dispatch
from django.db import transaction
from django.db.models import signals as model_signals

from . import client
from .pool import pool
from resolwe.flow import models as flow_models, serializers as flow_serializers, views as flow_views

# Register all viewsets with the query observer pool.
# TODO: This should be moved to a separate application.
pool.register_viewset(flow_views.CollectionViewSet)
pool.register_viewset(flow_views.DataViewSet)
pool.register_viewset(flow_views.ProcessViewSet)

# Setup model notifications.
observer_client = client.QueryObserverClient()


@dispatch.receiver(model_signals.post_save)
def model_post_save(sender, instance, created=False, **kwargs):
    """
    Signal emitted after any model is saved via Django ORM.
{'fraction_non_alphanumeric': 0.06372239747634069, 'fraction_numerical': 0.0, 'mean_word_length': 6.017699115044247, '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': '1907084', 'n_tokens_mistral': 437, 'n_tokens_neox': 421, 'n_words': 151}