code: def detach(self, sync=True):
          
          if self.attached():
              return self._session.detach(self, sync=sync)
          else:
              return 0
docs: Detach this result from its parent session by fetching the
          remainder of this result from the network into the buffer.
  
          :returns: number of records fetched