<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_python(self, reply, propagate=True):
 """Extracts the value out of the reply message. :param reply: In the case of a successful call the reply message will be:: {'ok': return_value, **default_fields} Therefore the method returns: return_value, **default_fields If the method raises an exception the reply message will be:: {'nok': [repr exc, str traceback], **default_fields} :keyword propagate - Propagate exceptions raised instead of returning a result representation of the error. """

        try:
            return reply['ok']
        except KeyError:
            error = self.Error(*reply.get('nok') or ())
            if propagate:
                raise error
            return error