<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def override(self, parameters, recursive = False):
 """ Overrides parameters with new values from specified Parameters and returns a new Parameters object. :param parameters: Parameters with parameters to override the current values. :param recursive: (optional) true to perform deep copy, and false for shallow copy. Default: false :return: a new Parameters object. """

        result = Parameters()

        if recursive:
            RecursiveObjectWriter.copy_properties(result, self)
            RecursiveObjectWriter.copy_properties(result, parameters)
        else:
            ObjectWriter.set_properties(result, self)
            ObjectWriter.set_properties(result, parameters)

        return result