<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def restore_population_parameters(self, global_default=True):
 """Setup UI for population parameter page from setting. :param global_default: If True, set to original default (from the value in definitions). :type global_default: bool """

        if global_default:
            data = generate_default_profile()
        else:
            data = setting('population_preference', generate_default_profile())
        if not isinstance(data, dict):
            LOGGER.debug(
                'population parameter is not a dictionary. InaSAFE will use '
                'the default one.')
            data = generate_default_profile()
        try:
            self.profile_widget.data = data
        except KeyError as e:
            LOGGER.debug(
                'Population parameter is not in correct format. InaSAFE will '
                'use the default one.')
            LOGGER.debug(e)
            data = generate_default_profile()
            self.profile_widget.data = data