Suggest the preferred forms.
960536
def check(text):
    """"""
    err = "hedging.misc"
    msg = "Hedging. Just say it."

    narcissism = [
        "I would argue that",
        ", so to speak",
        "to a certain degree",
    ]

    return existence_check(text, narcissism, err, msg)
91470
def form_valid(self, form):
        """"""
        form.categorize_metrics()
        return super(CategoryFormView, self).form_valid(form)
836913
public function showOptionsForm(): void
	{
		$form = new Options\Form($this->options, $this->ADMIN_FORM_ID);
		$form->handleRequest();
		$form->write();
	}
31018
public function buildForm()
    {

        $this
            ->add('range', 'datepicker',
                [
                    'label'      => trans('expendable::form.date'),
                    'validation' => 'required',
                    'range'      => true
                ])
            ->add('type', 'choice', [
                'choices'    => StaticLabel::typeExport(),
                'validation' => 'required',
                'label'      => trans('expendable::form.type')
            ])
            ->addDefaultActions();
    }
1145665
def answered_by(self, rec):
        """"""
        return self.clazz == rec.clazz and \
                (self.type == rec.type or self.type == _TYPE_ANY) and \
                self.name == rec.name
1334771
def chooseMany(choices):
    ''
    if isinstance(choices, dict):
        choosed = input('/'.join(choices.keys()) + ': ', completer=CompleteKey(choices)).split()
        return [choices[c] for c in choosed]
    else:
        return input('/'.join(str(x) for x in choices) + ': ', completer=CompleteKey(choices)).split()
1237643
def DEFINE_choice(name, default, choices, help):
  """"""
  _CONFIG.DEFINE_choice(name, default, choices, help)
359640
def user_preference_form_builder(instance, preferences=[], **kwargs):
    
    return preference_form_builder(
        UserPreferenceForm,
        preferences,
        model={'instance': instance},
        **kwargs)
1329898
def add_form(self, **kwargs):
        """"""
        vocabularies = kwargs.get('vocabularies', None)
        qualifier = kwargs.get('qualifier', None)
        content = kwargs.get('content', None)
        parent_tag = kwargs.get('parent_tag', None)
        superuser = kwargs.get('superuser', False)
        # Element has both the qualifier and content.
        if qualifier is not None and content is not None:
            # Create the form attribute.
            self.form = UNTL_FORM_DISPATCH[self.tag](
                vocabularies=vocabularies,
                qualifier_value=qualifier,
                input_value=content,
                untl_object=self,
                superuser=superuser,
            )
        # Element just has a qualifier.
        elif qualifier is not None:
            # Create the form attribute.
            self.form = UNTL_FORM_DISPATCH[self.tag](
                vocabularies=vocabularies,
                qualifier_value=qualifier,
                untl_object=self,
                superuser=superuser,
            )
        # Element just has content.
        elif content is not None:
            # If the element is a child element,
            # create the form attribute.
            if parent_tag is None:
                self.form = UNTL_FORM_DISPATCH[self.tag](
                    vocabularies=vocabularies,
                    input_value=content,
                    untl_object=self,
                    superuser=superuser,
                )
            else:
                # Create the form attribute.
                self.form = UNTL_FORM_DISPATCH[self.tag](
                    vocabularies=vocabularies,
                    input_value=content,
                    untl_object=self,
                    parent_tag=parent_tag,
                    superuser=superuser,
                )
        # Element has children and no qualifiers or content
        # or is blank (not originally in the UNTL record).
        else:
            # Element is a child element.
            if parent_tag is None:
                # Create the form attribute.
                self.form = UNTL_FORM_DISPATCH[self.tag](
                    vocabularies=vocabularies,
                    untl_object=self,
                    superuser=superuser,
                )
            else:
                # Create the form attribute.
                self.form = UNTL_FORM_DISPATCH[self.tag](
                    vocabularies=vocabularies,
                    untl_object=self,
                    parent_tag=parent_tag,
                    superuser=superuser,
                )
400038
def get_form_kwargs(self):
        
        kwargs = super(ModelFormMixin, self).get_form_kwargs()
        kwargs['poll'] = self.object
        return kwargs
231302
def spelling_suggestions(self):
        """"""
        if not self.is_tagged(WORDS):
            self.tokenize_words()
        return [data[SUGGESTIONS] for data in vabamorf.spellcheck(self.word_texts, suggestions=True)]
1242950
function (suggestions) {
                var selectedSuggestions = this.selectedSuggestions;
                var filteredSuggestions = [];
                for (var i = 0; i < suggestions.length; i++) {
                    var curSuggestion = suggestions[i];
                    if (this._findSuggestion(selectedSuggestions, curSuggestion) == -1) {
                        filteredSuggestions.push(curSuggestion);
                    }
                }
                return filteredSuggestions;
            }
552744
function process_form($form, &$preferences){
        if (isset($form->jabber_jabberid) && !empty($form->jabber_jabberid)) {
            $preferences['message_processor_jabber_jabberid'] = $form->jabber_jabberid;
        }
    }
539184
def add_view(self, request, form_url='', extra_context=None):
        """"""
        extra_context = {
            'language': get_language_from_request(request),
            'page_languages': settings.PAGE_LANGUAGES,
        }
        return super(PageAdmin, self).add_view(request, form_url,
                                               extra_context)
667234
public function chooseLanguage() {
        if ($this->_saveOnCookies &&
            $tmpLng = $this->getRequiredModules('cookies')->getCookie($this->_cookieName)
        ) {

            $this->_selectedLanguage = $tmpLng;
        } elseif (isset($this->_app)) {
            try {
                $this->_selectedLanguage = $this->_app->getConfig()->getConfigData('default_language');
            } catch (\pff\ConfigException $e) {
                $this->_selectedLanguage = $this->_defaultLang;
            }
        } else {
            $this->_selectedLanguage = $this->_defaultLang;
        }
    }
997044
def get_form(self, request, obj=None, **kwargs):
        """"""

        template = get_template_from_request(request, obj)

        #model = create_page_model(get_placeholders(template))

        form = make_form(self.model, get_placeholders(template))

        # bound the form
        language = get_language_from_request(request)
        form.base_fields['language'].initial = language
        if obj:
            initial_slug = obj.slug(language=language, fallback=False)
            initial_title = obj.title(language=language, fallback=False)
            form.base_fields['slug'].initial = initial_slug
            form.base_fields['title'].initial = initial_title

        template = get_template_from_request(request, obj)
        page_templates = settings.get_page_templates()
        template_choices = list(page_templates)
        # is default template is not in the list add it
        if not [tpl for tpl in template_choices if tpl[0] == settings.PAGE_DEFAULT_TEMPLATE]:
            template_choices.insert(0, (settings.PAGE_DEFAULT_TEMPLATE,
                    _('Default template')))
        form.base_fields['template'].choices = template_choices
        form.base_fields['template'].initial = force_text(template)

        for placeholder in get_placeholders(template):
            ctype = placeholder.ctype
            if obj:
                initial = placeholder.get_content(obj, language, lang_fallback=False)
            else:
                initial = None
            form.base_fields[ctype] = placeholder.get_field(obj,
                language, initial=initial)

        return form
677301
def _options():
    """"""
    opts = sys.argv[1:]
    return [click.Option((v.split('=')[0],)) for v in opts
            if v[0] == '-' and v != '--help']