<commit_before>import typing
from contextlib import suppress
from sqlite3 import IntegrityError

from django.contrib import messages
from django.contrib.auth.views import redirect_to_login
from django.core.cache import cache
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import models
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import etag

from c3nav.editor.forms import GraphEdgeSettingsForm, GraphEditorActionForm
from c3nav.editor.views.base import etag_func, sidebar_view
from c3nav.mapdata.models.access import AccessPermission


def child_model(request, model: typing.Union[str, models.Model], kwargs=None, parent=None):<commit_msg>import the correct IntegrityError<commit_after>import typing
from contextlib import suppress

from django.contrib import messages
from django.contrib.auth.views import redirect_to_login
from django.core.cache import cache
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import IntegrityError, models
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import etag

from c3nav.editor.forms import GraphEdgeSettingsForm, GraphEditorActionForm
from c3nav.editor.views.base import etag_func, sidebar_view
from c3nav.mapdata.models.access import AccessPermission


def child_model(request, model: typing.Union[str, models.Model], kwargs=None, parent=None):
{'fraction_non_alphanumeric': 0.056625802685347344, 'fraction_numerical': 0.007589025102159953, 'mean_word_length': 6.972093023255814, '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': '1660875', 'n_tokens_mistral': 473, 'n_tokens_neox': 465, 'n_words': 149}