<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _from_gerror(cls, error, own=True):
 """Creates a GError exception and takes ownership if own is True"""


        if not own:
            error = error.copy()

        self = cls()
        self._error = error
        return self