<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _construct_form(self, i, **kwargs):
 """ Construct the form, overriding the initial value for `language_code`. """

        if not settings.HIDE_LANGUAGE:
            self._construct_available_languages()

        form = super(TranslationFormSet, self)._construct_form(i, **kwargs)

        if settings.HIDE_LANGUAGE:
            form.instance.language_code = settings.DEFAULT_LANGUAGE
        else:
            language_code = form.instance.language_code

            if language_code:
                logger.debug(
                    u'Removing translation choice %s for instance %s'
                    u' in form %d', language_code, form.instance, i
                )

                self.available_languages.remove(language_code)

            else:
                initial_language_code = self._get_default_language()

                logger.debug(
                    u'Preselecting language code %s for form %d',
                    initial_language_code, i
                )

                form.initial['language_code'] = initial_language_code

        return form