<commit_before>import json
import os
import tempfile
from StringIO import StringIO
from corehq.apps.domain.views import BaseDomainView
from corehq.apps.style.decorators import use_bootstrap3, use_knockout_js, \
    use_select2, use_daterangepicker, use_jquery_ui, use_nvd3
from dimagi.utils.modules import to_function
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse, Http404
from django.utils.translation import ugettext as _, ugettext_noop
from braces.views import JSONResponseMixin
from corehq.apps.reports.dispatcher import (
    cls_to_view_login_and_domain,
    ReportDispatcher,
)
from corehq.apps.reports.models import ReportConfig
from corehq.apps.reports_core.exceptions import FilterException
from corehq.apps.userreports.exceptions import (
    BadSpecError,
    UserReportsError,
    TableNotFoundWarning,
    UserReportsFilterError,
)
from corehq.apps.userreports.models import (
    STATIC_PREFIX,
    CUSTOM_REPORT_PREFIX,
    StaticReportConfiguration,
    ReportConfiguration,
)
from corehq.apps.userreports.reports.factory import ReportFactory
from corehq.apps.userreports.reports.util import (
    get_expanded_columns,
    get_total_row,
)
from corehq.apps.userreports.util import default_language, localize
from corehq.util.couch import get_document_or_404, get_document_or_not_found, \
    DocumentNotFound
from couchexport.export import export_from_tables
from couchexport.models import Format
from dimagi.utils.couch.pagination import DatatablesParams
from dimagi.utils.decorators.memoized import memoized

from dimagi.utils.web import json_request
from no_exceptions.exceptions import Http403

from corehq.apps.reports.datatables import DataTablesHeader


class ConfigurableReport(JSONResponseMixin, BaseDomainView):
    section_name = ugettext_noop("Reports")
    template_name = 'userreports/configurable_report.html'
    slug = "configurable"
    prefix = slug
    emailable = True

    _domain = None

    @property
    def domain(self):
        if self._domain is not None:
            return self._domain
        return super(ConfigurableReport, self).domain

    @use_bootstrap3
    @use_knockout_js
    @use_select2
    @use_daterangepicker
    @use_jquery_ui
    @use_nvd3<commit_msg>add use_datatables to userconfig report view<commit_after>import json
import os
import tempfile
from StringIO import StringIO
from corehq.apps.domain.views import BaseDomainView
from corehq.apps.style.decorators import use_bootstrap3, use_knockout_js, \
    use_select2, use_daterangepicker, use_jquery_ui, use_nvd3, use_datatables
from dimagi.utils.modules import to_function
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse, Http404
from django.utils.translation import ugettext as _, ugettext_noop
from braces.views import JSONResponseMixin
from corehq.apps.reports.dispatcher import (
    cls_to_view_login_and_domain,
    ReportDispatcher,
)
from corehq.apps.reports.models import ReportConfig
from corehq.apps.reports_core.exceptions import FilterException
from corehq.apps.userreports.exceptions import (
    BadSpecError,
    UserReportsError,
    TableNotFoundWarning,
    UserReportsFilterError,
)
from corehq.apps.userreports.models import (
    STATIC_PREFIX,
    CUSTOM_REPORT_PREFIX,
    StaticReportConfiguration,
    ReportConfiguration,
)
from corehq.apps.userreports.reports.factory import ReportFactory
from corehq.apps.userreports.reports.util import (
    get_expanded_columns,
    get_total_row,
)
from corehq.apps.userreports.util import default_language, localize
from corehq.util.couch import get_document_or_404, get_document_or_not_found, \
    DocumentNotFound
from couchexport.export import export_from_tables
from couchexport.models import Format
from dimagi.utils.couch.pagination import DatatablesParams
from dimagi.utils.decorators.memoized import memoized

from dimagi.utils.web import json_request
from no_exceptions.exceptions import Http403

from corehq.apps.reports.datatables import DataTablesHeader


class ConfigurableReport(JSONResponseMixin, BaseDomainView):
    section_name = ugettext_noop("Reports")
    template_name = 'userreports/configurable_report.html'
    slug = "configurable"
    prefix = slug
    emailable = True

    _domain = None

    @property
    def domain(self):
        if self._domain is not None:
            return self._domain
        return super(ConfigurableReport, self).domain

    @use_bootstrap3
    @use_knockout_js
    @use_select2
    @use_daterangepicker
    @use_jquery_ui
    @use_datatables
    @use_nvd3
{'fraction_non_alphanumeric': 0.05563813973242727, 'fraction_numerical': 0.006370779358674878, 'mean_word_length': 4.93198992443325, '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': '6632159', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1400, 'n_words': 332}