<commit_before>from django import forms
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy

from crispy_forms import bootstrap as twbscrispy
from crispy_forms import layout as crispy
from crispy_forms.bootstrap import PrependedText, StrictButton
from crispy_forms.helper import FormHelper

from corehq.apps.app_manager.util import is_linked_app
from corehq.apps.builds.models import BuildSpec
from corehq.apps.domain.models import Domain
from corehq.apps.hqwebapp import crispy as hqcrispy
from corehq.apps.linked_domain.models import DomainLink
from corehq import toggles

from .dbaccessors import get_all_built_app_ids_and_versions
from .models import LATEST_APK_VALUE, LATEST_APP_VALUE
from .util import get_commcare_builds
from ..accounting.utils import domain_has_privilege
from ..hqwebapp.widgets import BootstrapCheckboxInput
from ...privileges import RELEASE_MANAGEMENT


class CopyApplicationForm(forms.Form):
    domain = forms.CharField(
        label=ugettext_lazy("Copy this app to project"),
        widget=forms.Select(choices=[], attrs={
            "data-bind": "autocompleteSelect2: domainNames, event:{ change: domainChanged }",
        }))
    name = forms.CharField(required=True, label=ugettext_lazy('Name'))
    linked = forms.BooleanField(
        required=False,
        label=_('Copy as Linked Application'),
        widget=BootstrapCheckboxInput(
            inline_label=mark_safe(_(
                "<!-- ko ifnot: shouldEnableLinkedAppOption -->"
                "Cannot link this application with the selected project space."
                "<!-- /ko -->"
            )),  # nosec: no user input
            attrs={"data-bind": "enable: shouldEnableLinkedAppOption, checked: isChecked"},
        ),
        help_text=_("This will create an application that can be updated from changes to this application."
                    " This requires your app to have at least one released version."),
    )
    build_id = forms.CharField(<commit_msg>update message text<commit_after>from django import forms
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy

from crispy_forms import bootstrap as twbscrispy
from crispy_forms import layout as crispy
from crispy_forms.bootstrap import PrependedText, StrictButton
from crispy_forms.helper import FormHelper

from corehq.apps.app_manager.util import is_linked_app
from corehq.apps.builds.models import BuildSpec
from corehq.apps.domain.models import Domain
from corehq.apps.hqwebapp import crispy as hqcrispy
from corehq.apps.linked_domain.models import DomainLink
from corehq import toggles

from .dbaccessors import get_all_built_app_ids_and_versions
from .models import LATEST_APK_VALUE, LATEST_APP_VALUE
from .util import get_commcare_builds
from ..accounting.utils import domain_has_privilege
from ..hqwebapp.widgets import BootstrapCheckboxInput
from ...privileges import RELEASE_MANAGEMENT


class CopyApplicationForm(forms.Form):
    domain = forms.CharField(
        label=ugettext_lazy("Copy this app to project"),
        widget=forms.Select(choices=[], attrs={
            "data-bind": "autocompleteSelect2: domainNames, event:{ change: domainChanged }",
        }))
    name = forms.CharField(required=True, label=ugettext_lazy('Name'))
    linked = forms.BooleanField(
        required=False,
        label=_('Copy as Linked Application'),
        widget=BootstrapCheckboxInput(
            inline_label=mark_safe(_(
                "<!-- ko ifnot: shouldEnableLinkedAppOption -->"
                "The selected project space must first be linked to the current project space."
                "<!-- /ko -->"
            )),  # nosec: no user input
            attrs={"data-bind": "enable: shouldEnableLinkedAppOption, checked: isChecked"},
        ),
        help_text=_("This will create an application that can be updated from changes to this application."
                    " This requires your app to have at least one released version."),
    )
    build_id = forms.CharField(
{'fraction_non_alphanumeric': 0.07659574468085106, 'fraction_numerical': 0.00047281323877068556, 'mean_word_length': 3.695893451720311, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, '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': '341582', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1165, 'n_words': 348}