<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _method_complete(self, result):
 """Called after an extention method with the result."""

    if isinstance(result, PrettyTensor):
      self._head = result
      return self
    elif isinstance(result, Loss):
      return result
    elif isinstance(result, PrettyTensorTupleMixin):
      self._head = result[0]
      return result
    else:
      self._head = self._head.with_tensor(result)
      return self