<commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import six
from django.urls import reverse
from corehq import privileges
from corehq.apps.domain.dbaccessors import get_doc_ids_in_domain_by_class
from corehq.apps.domain.models import Domain
from corehq.apps.hqadmin.reports import (
    AdminDomainStatsReport,
    AdminDomainMapReport,
    AdminDomainMapInternal,
    AdminAppReport,
    AdminPhoneNumberReport,
    AdminUserReport,
    RealProjectSpacesReport,
    CommConnectProjectSpacesReport,
    CommTrackProjectSpacesReport,
    DeviceLogSoftAssertReport,
    CommCareVersionReport,
    UserAuditReport)
from corehq.apps.hqpillow_retry.views import PillowErrorsReport
from corehq.apps.linked_domain.views import DomainLinkHistoryReport
from corehq.apps.reports.standard import (
    monitoring, inspect,
    deployments, sms, ivr
)
from corehq.apps.reports.standard.forms import reports as receiverwrapper
from corehq.apps.reports.standard.project_health import ProjectHealthDashboard
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userreports.models import (
    StaticReportConfiguration,
    ReportConfiguration,
)
from corehq.apps.userreports.reports.view import (
    ConfigurableReportView,
    CustomConfigurableReportDispatcher,
)
from corehq.apps.userreports.views import TEMP_REPORT_PREFIX
from corehq.form_processor.utils import should_use_sql_backend
import phonelog.reports as phonelog
from corehq.apps.reports import commtrack
from corehq.apps.reports.standard.cases.case_list_explorer import CaseListExplorer
from corehq.apps.fixtures.interface import FixtureViewInterface, FixtureEditInterface
import hashlib
from dimagi.utils.modules import to_function
import logging
from . import toggles
from django.utils.translation import ugettext_noop as _, ugettext_lazy
from corehq.apps.indicators.admin import document_indicators, couch_indicators, dynamic_indicators
from corehq.apps.data_interfaces.interfaces import CaseReassignmentInterface, BulkFormManagementInterface
from corehq.apps.case_importer.base import ImportCases
from corehq.apps.accounting.interface import (
    AccountingInterface,
    SubscriptionInterface,
    SoftwarePlanInterface,
    InvoiceInterface,
    WireInvoiceInterface,
    PaymentRecordInterface,
    SubscriptionAdjustmentInterface,
    CreditAdjustmentInterface,
)
from corehq.apps.smsbillables.interface import (
    SMSBillablesInterface,
    SMSGatewayFeeCriteriaInterface,
)
from corehq.motech.repeaters.views import DomainForwardingRepeatRecords
from custom.openclinica.reports import OdmExportReport


def REPORTS(project):
    from corehq.apps.reports.standard.cases.basic import CaseListReport

    report_set = None
    if project.report_whitelist:
        report_set = set(project.report_whitelist)
    reports = []

    reports.extend(_get_configurable_reports(project))

    monitoring_reports = (
        monitoring.WorkerActivityReport,
        monitoring.DailyFormStatsReport,
        monitoring.SubmissionsByFormReport,
        monitoring.FormCompletionTimeReport,
        monitoring.CaseActivityReport,
        monitoring.FormCompletionVsSubmissionTrendsReport,
        monitoring.WorkerActivityTimes,
        ProjectHealthDashboard,
    )
    inspect_reports = (
        inspect.SubmitHistory, CaseListReport, OdmExportReport,
    )
    deployments_reports = (
        deployments.ApplicationStatusReport,
        deployments.AggregateUserStatusReport,
        receiverwrapper.SubmissionErrorReport,
        phonelog.DeviceLogDetailsReport,
        deployments.ApplicationErrorReport,
    )
    experimental_reports = []
    if toggles.CASE_LIST_EXPLORER.enabled(project.name):
        experimental_reports.append(CaseListExplorer)

    monitoring_reports = _filter_reports(report_set, monitoring_reports)
    inspect_reports = _filter_reports(report_set, inspect_reports)
    deployments_reports = _filter_reports(report_set, deployments_reports)
    experimental_reports = _filter_reports(report_set, experimental_reports)

    reports.extend([
        (ugettext_lazy("Monitor Workers"), monitoring_reports),
        (ugettext_lazy("Inspect Data"), inspect_reports),
        (ugettext_lazy("Manage Deployments"), deployments_reports),
        (ugettext_lazy("Experimental"), experimental_reports)
    ])

    if project.commtrack_enabled:
        supply_reports = (
            commtrack.SimplifiedInventoryReport,
            commtrack.InventoryReport,
            commtrack.CurrentStockStatusReport,<commit_msg>Case List explorer is not experimental<commit_after>from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import six
from django.urls import reverse
from corehq import privileges
from corehq.apps.domain.dbaccessors import get_doc_ids_in_domain_by_class
from corehq.apps.domain.models import Domain
from corehq.apps.hqadmin.reports import (
    AdminDomainStatsReport,
    AdminDomainMapReport,
    AdminDomainMapInternal,
    AdminAppReport,
    AdminPhoneNumberReport,
    AdminUserReport,
    RealProjectSpacesReport,
    CommConnectProjectSpacesReport,
    CommTrackProjectSpacesReport,
    DeviceLogSoftAssertReport,
    CommCareVersionReport,
    UserAuditReport)
from corehq.apps.hqpillow_retry.views import PillowErrorsReport
from corehq.apps.linked_domain.views import DomainLinkHistoryReport
from corehq.apps.reports.standard import (
    monitoring, inspect,
    deployments, sms, ivr
)
from corehq.apps.reports.standard.forms import reports as receiverwrapper
from corehq.apps.reports.standard.project_health import ProjectHealthDashboard
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userreports.models import (
    StaticReportConfiguration,
    ReportConfiguration,
)
from corehq.apps.userreports.reports.view import (
    ConfigurableReportView,
    CustomConfigurableReportDispatcher,
)
from corehq.apps.userreports.views import TEMP_REPORT_PREFIX
from corehq.form_processor.utils import should_use_sql_backend
import phonelog.reports as phonelog
from corehq.apps.reports import commtrack
from corehq.apps.reports.standard.cases.case_list_explorer import CaseListExplorer
from corehq.apps.fixtures.interface import FixtureViewInterface, FixtureEditInterface
import hashlib
from dimagi.utils.modules import to_function
import logging
from . import toggles
from django.utils.translation import ugettext_noop as _, ugettext_lazy
from corehq.apps.indicators.admin import document_indicators, couch_indicators, dynamic_indicators
from corehq.apps.data_interfaces.interfaces import CaseReassignmentInterface, BulkFormManagementInterface
from corehq.apps.case_importer.base import ImportCases
from corehq.apps.accounting.interface import (
    AccountingInterface,
    SubscriptionInterface,
    SoftwarePlanInterface,
    InvoiceInterface,
    WireInvoiceInterface,
    PaymentRecordInterface,
    SubscriptionAdjustmentInterface,
    CreditAdjustmentInterface,
)
from corehq.apps.smsbillables.interface import (
    SMSBillablesInterface,
    SMSGatewayFeeCriteriaInterface,
)
from corehq.motech.repeaters.views import DomainForwardingRepeatRecords
from custom.openclinica.reports import OdmExportReport


def REPORTS(project):
    from corehq.apps.reports.standard.cases.basic import CaseListReport

    report_set = None
    if project.report_whitelist:
        report_set = set(project.report_whitelist)
    reports = []

    reports.extend(_get_configurable_reports(project))

    monitoring_reports = (
        monitoring.WorkerActivityReport,
        monitoring.DailyFormStatsReport,
        monitoring.SubmissionsByFormReport,
        monitoring.FormCompletionTimeReport,
        monitoring.CaseActivityReport,
        monitoring.FormCompletionVsSubmissionTrendsReport,
        monitoring.WorkerActivityTimes,
        ProjectHealthDashboard,
    )
    inspect_reports = [
        inspect.SubmitHistory, CaseListReport, OdmExportReport,
    ]
    if toggles.CASE_LIST_EXPLORER.enabled(project.name):
        inspect_reports.append(CaseListExplorer)
    deployments_reports = (
        deployments.ApplicationStatusReport,
        deployments.AggregateUserStatusReport,
        receiverwrapper.SubmissionErrorReport,
        phonelog.DeviceLogDetailsReport,
        deployments.ApplicationErrorReport,
    )

    monitoring_reports = _filter_reports(report_set, monitoring_reports)
    inspect_reports = _filter_reports(report_set, inspect_reports)
    deployments_reports = _filter_reports(report_set, deployments_reports)

    reports.extend([
        (ugettext_lazy("Monitor Workers"), monitoring_reports),
        (ugettext_lazy("Inspect Data"), inspect_reports),
        (ugettext_lazy("Manage Deployments"), deployments_reports),
    ])

    if project.commtrack_enabled:
        supply_reports = (
            commtrack.SimplifiedInventoryReport,
            commtrack.InventoryReport,
            commtrack.CurrentStockStatusReport,
{'fraction_non_alphanumeric': 0.056635202665186006, 'fraction_numerical': 0.0, 'mean_word_length': 4.867100977198697, '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': '6565840', 'n_tokens_mistral': 2579, 'n_tokens_neox': 2496, 'n_words': 460}