<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inflate_parameter_leaf(sub_parameter, base_year, inflator, unit_type = 'unit'):
 """ Inflate a Parameter leaf according to unit type Basic unit type are supposed by default Other admissible unit types are threshold_unit and rate_unit """


    if isinstance(sub_parameter, Scale):
        if unit_type == 'threshold_unit':
            for bracket in sub_parameter.brackets:
                threshold = bracket.children['threshold']
                inflate_parameter_leaf(threshold, base_year, inflator)
            return
    else:
        # Remove new values for year > base_year
        kept_instants_str = [
            parameter_at_instant.instant_str
            for parameter_at_instant in sub_parameter.values_list
            if periods.instant(parameter_at_instant.instant_str).year <= base_year
            ]
        if not kept_instants_str:
            return

        last_admissible_instant_str = max(kept_instants_str)
        sub_parameter.update(
            start = last_admissible_instant_str,
            value = sub_parameter(last_admissible_instant_str)
            )
        restricted_to_base_year_value_list = [
            parameter_at_instant for parameter_at_instant in sub_parameter.values_list
            if periods.instant(parameter_at_instant.instant_str).year == base_year
            ]
        # When value is changed in the base year
        if restricted_to_base_year_value_list:
            for parameter_at_instant in reversed(restricted_to_base_year_value_list):
                if parameter_at_instant.instant_str.startswith(str(base_year)):
                    value = (
                        parameter_at_instant.value * (1 + inflator)
                        if parameter_at_instant.value is not None
                        else None
                        )
                    sub_parameter.update(
                        start = parameter_at_instant.instant_str.replace(
                            str(base_year), str(base_year + 1)
                            ),
                        value = value,
                        )
        # Or use the value at that instant even when it is defined earlier tahn the base year
        else:
            value = (
                sub_parameter("{}-12-31".format(base_year)) * (1 + inflator)
                if sub_parameter("{}-12-31".format(base_year)) is not None
                else None
                )
            sub_parameter.update(
                start = "{}-01-01".format(base_year + 1),
                value = value
                )