<commit_before># -*- coding: utf-8 -*-

from django import forms
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.text import Truncator

from rest_framework import routers
from rest_framework.decorators import api_view
from rest_framework.response import Response

from chemtrails.contrib.permissions.models import AccessRule
from chemtrails.contrib.permissions.views import AccessRuleViewSet, MetaGraphView
from chemtrails.contrib.permissions.forms import CypherWidget
from chemtrails.neoutils.query import get_node_relationship_types
from chemtrails.neoutils import get_node_for_object
from chemtrails.neoutils.query import validate_cypher


class AccessRuleForm(forms.ModelForm):

    cypher_statement = forms.CharField(widget=CypherWidget, required=False)<commit_msg>Added help text to cypher widget<commit_after># -*- coding: utf-8 -*-

from django import forms
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.text import Truncator

from rest_framework import routers
from rest_framework.decorators import api_view
from rest_framework.response import Response

from chemtrails.contrib.permissions.models import AccessRule
from chemtrails.contrib.permissions.views import AccessRuleViewSet, MetaGraphView
from chemtrails.contrib.permissions.forms import CypherWidget
from chemtrails.neoutils.query import get_node_relationship_types
from chemtrails.neoutils import get_node_for_object
from chemtrails.neoutils.query import validate_cypher


class AccessRuleForm(forms.ModelForm):

    cypher_statement = forms.CharField(widget=CypherWidget, required=False,
                                       help_text=_('Preview the generated cypher statement. Any changes done in '
                                                   'this view will <b>not</b> be saved. <br />Note that this '
                                                   'is generated using a mock source node, which means that filter '
                                                   'parameters will be replaced with real values on evaluation.'
                                                   ''))
{'fraction_non_alphanumeric': 0.05275590551181102, 'fraction_numerical': 0.0007874015748031496, 'mean_word_length': 3.5949367088607596, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '236394', 'n_tokens_mistral': 632, 'n_tokens_neox': 616, 'n_words': 201}