<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_parameter(self, name, par, value, true_value=True, scale=None, bounds=None, error=None, update_source=True):
 """ Update the value of a parameter. Parameter bounds will automatically be adjusted to encompass the new parameter value. Parameters name : str Source name. par : str Parameter name. value : float Parameter value. By default this argument should be the unscaled (True) parameter value. scale : float Parameter scale (optional). Value argument is interpreted with respect to the scale parameter if it is provided. error : float Parameter error (optional). By default this argument should be the unscaled (True) parameter value. update_source : bool Update the source dictionary for the object. """

        name = self.roi.get_source_by_name(name).name
        idx = self.like.par_index(name, par)
        current_bounds = list(self.like.model[idx].getBounds())

        if scale is not None:
            self.like[idx].setScale(scale)
        else:
            scale = self.like.model[idx].getScale()

        if true_value:
            current_bounds[0] = min(current_bounds[0], value / scale)
            current_bounds[1] = max(current_bounds[1], value / scale)
            if error is not None:
                error = error / scale
        else:
            current_bounds[0] = min(current_bounds[0], value)
            current_bounds[1] = max(current_bounds[1], value)

        # update current bounds to encompass new value
        self.like[idx].setBounds(*current_bounds)

        if true_value:
            for p in self.like[idx].pars:
                p.setTrueValue(value)
        else:
            self.like[idx].setValue(value)

        if bounds is not None:
            if true_value:
                bounds[0] = min(bounds[0], value / scale)
                bounds[1] = max(bounds[1], value / scale)
            else:
                bounds[0] = min(bounds[0], value)
                bounds[1] = max(bounds[1], value)

        # For some reason the numerical accuracy is causing this to throw exceptions.
        try:
            if bounds is not None:
                self.like[idx].setBounds(*bounds)
        except RuntimeError:
            self.logger.warning(
                "Caught failure on setBounds for %s::%s." % (name, par))
            pass

        if error is not None:
            self.like[idx].setError(error)

        self._sync_params(name)

        if update_source:
            self.update_source(name)