<commit_before># -*- coding: UTF-8 -*-
# Copyright 2013-2014 <NAME>
# License: BSD (see file COPYING for details)

"""

.. management_command:: initdb_demo

Calls :manage:`initdb` using the application's
:attr:`lino.core.site.Site.demo_fixtures`.

Introduction see :ref:`lino.tutorial.hello`.

"""
from past.builtins import basestring

from django.conf import settings
from lino.modlib.lino_startup.management.commands.initdb import Command as BaseCommand
from lino.modlib.lino_startup.management.commands.initdb import CommandError


class Command(BaseCommand):
    help = __doc__

    def handle(self, *args, **options):<commit_msg>Fix initdb_demo command (Django 1.10)<commit_after># -*- coding: UTF-8 -*-
# Copyright 2013-2014 <NAME>
# License: BSD (see file COPYING for details)

"""

.. management_command:: initdb_demo

Calls :manage:`initdb` using the application's
:attr:`lino.core.site.Site.demo_fixtures`.

Introduction see :ref:`lino.tutorial.hello`.

"""
from past.builtins import basestring

from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from lino.modlib.lino_startup.management.commands.initdb import Command as BaseCommand
from lino.modlib.lino_startup.management.commands.initdb import CommandError


class Command(BaseCommand):
    help = __doc__

    def add_arguments(self, parser):
        parser.add_argument('--noinput', action='store_false',
                            dest='interactive', default=True,
                            help='Do not prompt for input of any kind.'),
        parser.add_argument('--database', action='store', dest='database',
                            default=DEFAULT_DB_ALIAS,
                            help='Nominates a database to reset. '
                                 'Defaults to the "default" database.')

    def handle(self, *args, **options):
{'fraction_non_alphanumeric': 0.11328976034858387, 'fraction_numerical': 0.011437908496732025, 'mean_word_length': 3.373809523809524, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1085458', 'n_tokens_mistral': 563, 'n_tokens_neox': 531, 'n_words': 136}