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
543189
def detach(self, sync=True):
        
        if self.attached():
            return self._session.detach(self, sync=sync)
        else:
            return 0
324669
def _get_buffered_response(self):
        

        response = self._get_response()

        if response.request.method == 'DELETE' and response.status_code == 204:
            return [{'status': 'record deleted'}], 1

        result = self._response.json().get('result', None)

        if result is None:
            raise MissingResult('The expected `result` key was missing in the response. Cannot continue')

        length = 0

        if isinstance(result, list):
            length = len(result)
        elif isinstance(result, dict):
            result = [result]
            length = 1

        return result, length
921962
def fetch_unload_restriction(self, ):
        
        inter = self.get_refobjinter()
        restricted = self.status() != self.LOADED or self.get_children_to_delete()
        return restricted or inter.fetch_action_restriction(self, 'unload')
330741
def release(self, connection):
        
        self._checkpid()
        if connection.pid != self.pid:
            return

        # Remove the current connection from _in_use_connection and add it back to the available pool
        # There is cases where the connection is to be removed but it will not exist and there
        # must be a safe way to remove
        i_c = self._in_use_connections.get(connection.node["name"], set())
        if connection in i_c:
            i_c.remove(connection)
        else:
            pass
        # discard connection with unread response
        if connection.awaiting_response:
            connection.disconnect()
            # reduce node connection count in case of too many connection error raised
            if self.max_connections_per_node and self._created_connections_per_node.get(connection.node['name']):
                self._created_connections_per_node[connection.node['name']] -= 1
        else:
            self._available_connections.setdefault(connection.node["name"], []).append(connection)
576257
def detachChildren(self):
        
        detached = self.children
        self.children = []
        for child in detached:
            child.parent = None
        return detached
654174
def fetch(self):
        
        from neobolt.exceptions import ConnectionExpired
        if self._connection:
            try:
                detail_count, _ = self._connection.fetch()
            except ConnectionExpired as error:
                raise SessionExpired(*error.args)
            else:
                return detail_count
        return 0
779615
def clearConnections( self, cls ):
        
        count = 0
        for connection in self.connections(cls):
            connection.remove()
            count += 1
        return count
410276
def next(self):
        
        if self._has_finished:
            raise StopIteration

        if not len(self._buffer):
                    
            results = self.fetch_next_block()
            self._buffer.extend(results)
            
        if not len(self._buffer):
            raise StopIteration
            
        return self._buffer.popleft()
1102995
def fetch(self):
        
        LOGGER.debug('Fetching session data: %s', self.id)
        result = yield gen.Task(RedisSession._redis_client.get, self._key)
        if result:
            self.loads(result)
            raise gen.Return(True)
        else:
            raise gen.Return(False)
144046
def clear(self, session):
        
        try:
            sess = self.sessions[session]
        except KeyError:
            return constants.StatusCode.error_invalid_object
        return sess.clear()
344541
def next(self):
        
        if self._records_iter >= len(self._records):
            raise StopIteration
        self._records_iter += 1
        return self._records[self._records_iter - 1]
791873
long refreshAndGetTotal() {
		long total = 0;

		for (InputChannel channel : inputGate.getInputChannels().values()) {
			if (channel instanceof RemoteInputChannel) {
				RemoteInputChannel rc = (RemoteInputChannel) channel;

				total += rc.unsynchronizedGetNumberOfQueuedBuffers();
			}
		}

		return total;
	}
145884
def get_unspent_outputs(self):
        
        cursor = backend.query.get_unspent_outputs(self.connection)
        return (record for record in cursor)
100417
def getResultsTotalCount(self):
        
        count = 0
        for val in self.getRawResults().values():
            count += len(val)
        return count
1469
def fetchone(self):
        
        if self._state == self._STATE_NONE:
            raise Exception("No query yet")
        if not self._data:
            return None
        else:
            self._rownumber += 1
            return self._data.pop(0)
625447
def fetchone(self):
        
        self._assert_valid_result_set()
        result = self.result_set.fetch_row()
        if len(result) == 0:
            return None
        else:
            return result
450185
def delete(self):
        
        session = self._session
        url = session._build_url(self._resource_path(), self.id)
        return session.delete(url, CB.boolean(204))