<commit_before>{#
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#}
{#
## See http://flask.pocoo.org/docs/patterns/wtforms/
#}
{% macro render_field(field, show_error_list=True, show_description=False) %}{% set fieldkwargs = kwargs %}{% block render_field scoped %}
  {% set label_size = fieldkwargs.get('label_size') %}
  {% set field_size = fieldkwargs.get('field_size') %}
  {%- if field.name == "csrf_token" or field.type == 'HiddenField' -%}
  {{ field(**fieldkwargs)|safe }}
  {%- else -%}
  <div class="form-group {% if show_error_list and field.errors %} has-error{% endif %}">
    {% set label_classes = "control-label" %}
    {% if label_size %}
      {% set label_classes = label_classes + ' col-md-' + label_size|string %}
    {% endif %}
    {{ field.label(class_=label_classes) }}
    {% set classes = fieldkwargs.get('class_', '') + ' form-control' %}
    {% do fieldkwargs.update({'class_': classes }) %}
    {% if field_size %}
      <div class="col-md-{{field_size|string}}">
    {% endif %}
    {{ field(**fieldkwargs)|safe }}
    {% if show_error_list and field.errors %}
      {% for error in field.errors %}
      <span class="help-block">{{ error }}</span>
      {% endfor %}
    {% endif %}<commit_msg>base: render field enhancement<commit_after>{#
## This file is part of Invenio.
## Copyright (C) 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#}
{#
## See http://flask.pocoo.org/docs/patterns/wtforms/
#}
{% macro render_field(field, show_error_list=True, show_description=False) %}{% set fieldkwargs = kwargs %}{% block render_field scoped %}
  {% set label_size = fieldkwargs.get('label_size') %}
  {% set field_size = fieldkwargs.get('field_size') %}
  {% set with_label = fieldkwargs.pop('with_label', True) %}
  {%- if field.name == "csrf_token" or field.type == 'HiddenField' -%}
  {{ field(**fieldkwargs)|safe }}
  {%- else -%}
  <div class="form-group {% if show_error_list and field.errors %} has-error{% endif %}">
    {% if with_label %}
      {% set label_classes = "control-label" %}
      {% if label_size %}
        {% set label_classes = label_classes + ' col-md-' + label_size|string %}
      {% endif %}
      {{ field.label(class_=label_classes) }}
    {% endif %}
    {% set classes = fieldkwargs.get('class_', '') + ' form-control' %}
    {% do fieldkwargs.update({'class_': classes }) %}
    {% if field_size %}
      <div class="col-md-{{field_size|string}}">
    {% endif %}
    {{ field(**fieldkwargs)|safe }}
    {% if show_error_list and field.errors %}
      {% for error in field.errors %}
      <span class="help-block">{{ error }}</span>
      {% endfor %}
    {% endif %}
{'fraction_non_alphanumeric': 0.15017404276479362, 'fraction_numerical': 0.011437095972153158, 'mean_word_length': 3.772241992882562, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1681708', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1197, 'n_words': 400}