<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _wrap(self, ret):
 """ Returns result but ig chain method is used returns the object itself so we can chain """

        if self.chained:
            self._wrapped = ret
            return self
        else:
            return ret