Extracts the results from the Neo4j Response.

@param $resultSet
499052
private function extractResults($resultSet)
    {
        foreach ($resultSet['results'] as $result) {
            foreach ($result['data'] as $data) {
                if (isset($data['graph'])) {
                    foreach ($data['graph']['nodes'] as $node) {
                        $this->nodesMap[$node['id']] = $node;
                    }
                    foreach ($data['graph']['relationships'] as $rel) {
                        $this->relationshipsMap[$rel['id']] = $rel;
                    }
                }
            }
        }
    }
527621
public function findBySet( Set $keySet )
    {

        $dataTypes = $this->dataTypesGet( DataType::PRIMARY_KEYS );

        if( count( $dataTypes ) == 0 ) {
            throw new \EntityPrimar("No primary keys for this entity. Don't know what key(s) to lookup on. Sorry.");
        }

        $identifiers = array();
        foreach( $dataTypes as $dataType ) {
            $identifiers[] = $this->db->quoteIdent( $dataType->name );
        }

        $keySet->sqlIdentifierSet(
            implode(
                "||'" . Base::KEY_SEPARATOR . "'||",
                $identifiers
            )
        );

        // lookup data
        $query = new Query(
            sprintf(
                "SELECT * FROM ONLY %s WHERE %s",
                 $this->db->quoteIdent( $this->__get('table') ),
                 '%keySet:%'
            ),
            array(
                'keySet' => $keySet
            )
        );

        $result = $this->db->query( $query );
        $datas = $result->fetch( Result::FLATTEN_PREVENT );

        return $this->initByDatas( $datas );

    }
352328
private function _resultSet()
    {
        if (!isset($this->_resultSet)) {
            foreach ($this->_before as $callback) {
                $callback($this->_query);
            }
            $this->_resultSet = $this->_query->execute();
        }

        return $this->_resultSet;
    }
638462
private function parseFacetsIntoObjects(SearchResultSet $resultSet)
    {
        // Make sure we can access the facet configuration
        if (!$resultSet->getUsedSearchRequest() || !$resultSet->getUsedSearchRequest()->getContextTypoScriptConfiguration()) {
            return $resultSet;
        }

        // Read the response
        $response = $resultSet->getResponse();
        if (!is_object($response->facet_counts) && !is_object($response->facets)) {
            return $resultSet;
        }

        /** @var FacetRegistry $facetRegistry */
        $facetRegistry = $this->getFacetRegistry();
        $facetsConfiguration = $resultSet->getUsedSearchRequest()->getContextTypoScriptConfiguration()->getSearchFacetingFacets();

        foreach ($facetsConfiguration as $name => $options) {
            if (!is_array($options)) {
                continue;
            }
            $facetName = rtrim($name, '.');
            $type = !empty($options['type']) ? $options['type'] : '';

            $parser = $facetRegistry->getPackage($type)->getParser();
            $facet = $parser->parse($resultSet, $facetName, $options);
            if ($facet !== null) {
                $resultSet->addFacet($facet);
            }
        }

        $this->applyRequirements($resultSet);

        return $resultSet;
    }
442071
public function partitionFacts( $variableSet )
	{
		if ( ! $this->var->bindAsSequence ) return;

		$groups = array();

		// This is a bit belt-and-braces but just to be sure
		if ( $this->facts instanceof XPath2NodeIterator )
		{
			$groups[] = $this->facts->CloneInstance();
		}
		else if ( is_array( $this->facts ) )
		{
			$groups[] = DocumentOrderNodeIterator::fromItemset( $this->facts, true );
		}
		else
		{
			$groups[] = DocumentOrderNodeIterator::fromItemset( array( $this->facts ) );
		}

		$this->facts = DocumentOrderNodeIterator::fromItemset( $groups );
	}
152464
public function eagerlyResultSet(&$resultSet, $relation, $withRelationAttr = [], $join = false)
    {
        $relations = is_string($relation) ? explode(',', $relation) : $relation;

        foreach ($relations as $key => $relation) {
            $subRelation = '';
            $closure     = null;

            if ($relation instanceof \Closure) {
                $closure  = $relation;
                $relation = $key;
            }

            if (is_array($relation)) {
                $subRelation = $relation;
                $relation    = $key;
            } elseif (strpos($relation, '.')) {
                list($relation, $subRelation) = explode('.', $relation, 2);
            }

            $relation     = Db::parseName($relation, 1, false);
            $relationName = Db::parseName($relation);

            $relationResult = $this->$relation();

            if (isset($withRelationAttr[$relationName])) {
                $relationResult->withAttr($withRelationAttr[$relationName]);
            }

            $relationResult->eagerlyResultSet($resultSet, $relation, $subRelation, $closure, $join);
        }
    }
514386
function _select (node, expr) {
        var
            resultSet,
            nodeSet = [node];
        while (expr) {
            resultSet = [];
            _test(nodeSet, expr, resultSet);
            if (0 === resultSet.length) {
                return [];
            }
            nodeSet = resultSet;
            if (expr.filter) {
                resultSet = [];
                _each(nodeSet, _filter, expr.filter, resultSet);
                if (0 === resultSet.length) {
                    return [];
                }
                nodeSet = resultSet;
            }
            expr = expr.then;
        }
        return resultSet;
    }
440165
public function selectMany(Select $select, ResultSet\ResultSetInterface $resultSet = null)
    {
        if ($this->usePaginator) {
            $this->usePaginator = false;
            $rows = $this->initPaginator($select, $resultSet);
        } else {
            $result = $this->select($select, $resultSet);
            $rows = array();
            foreach ($result as $row) {
                $rows[] = $row;
            }
        }
        return $rows;
    }
1070599
private List iterateAndReturn(ResultSet rSet) {
        Iterator<Row> rowIter = rSet.iterator();
        List results = new ArrayList();

        while (rowIter.hasNext()) {
            Row row = rowIter.next();
            ColumnDefinitions columnDefs = row.getColumnDefinitions();
            Iterator<Definition> columnDefIter = columnDefs.iterator();
            Map rowData = new HashMap();
            while (columnDefIter.hasNext()) {
                Definition columnDef = columnDefIter.next();
                rowData.put(columnDef.getName(), DSClientUtilities.assign(row, null, null,
                    columnDef.getType().getName(), null, columnDef.getName(), null, null));
            }
            results.add(rowData);
        }
        return results;
    }
177533
public function getColumnTypes($resultSet, $table){
		static $colTypes;
		if(empty($colTypes)){
			$constants = get_defined_constants(true);
			foreach($constants['mysqli'] as $type => $code){
				if(strncmp($type, 'MYSQLI_TYPE_', 12) === 0)
					$colTypes[$code] = strtolower(substr($type, 12));
			}
			$colTypes[MYSQLI_TYPE_LONG] = $colTypes[MYSQLI_TYPE_SHORT] = $colTypes[MYSQLI_TYPE_TINY] = 'int';
		}

		$cols = array();
		while($field = $resultSet->fetch_field()){
			$cols[$field->name] = $colTypes[$field->type];
		}
		return $cols;
	}
97998
def _pull_query_results(resultset):
    '''
    
    '''
    _results = collections.defaultdict(lambda: {})
    for _header, _values in resultset.items():
        _header, _group_tags = _header
        if _group_tags:
            _results[_header][salt.utils.json.dumps(_group_tags)] = [_value for _value in _values]
        else:
            _results[_header] = [_value for _value in _values]
    return dict(sorted(_results.items()))
1059559
@Override
    public DataBinder process(ResultSet rset) throws Exception {
        try {
            if (rset.next()) {
                ResultSetMetaData meta = rset.getMetaData();
                int width = meta.getColumnCount();
                for (int i = 1; i <= width; ++i) {
                    Object value = rset.getObject(i);
                    if (value != null) {
                        put(Strings.toLowerCamelCase(meta.getColumnLabel(i), '_'), value.toString());
                    }
                }
            } else {
                throw new NoSuchElementException("NoSuchRow");
            }
            return this;
        } finally {
            rset.close();
        }
    }
93948
private function mapDocuments(ResultSet $resultSet)
    {
        $mesages = [];

        foreach ($resultSet->getResults() as $result) {
            $mesages[] = $this->mapDocument($result->getSource());
        }

        return $mesages;
    }
400439
public function Filter( $facts, $variableSet )
	{
		// Look for the variable
		$vars = $variableSet->getBindingsAsVars();
		$clark = str_replace( "{}", "", "{{$this->variable['namespace']}}{$this->variable['name']}" );
		if ( ! isset( $vars[ $clark ] ) )
		{
			// Should probably throw some kind of error here
			throw XPath2Exception::withErrorCodeAndParam( "XPST0008", Resources::XPST0008, $clark );
		}

		/**
		 * @var \DOMNode[] $candidates
		 */
		$candidate = null;
		$var = $vars[ $clark ];
		if ( $var instanceof XPath2NodeIterator )
		{
			$node = reset( $var->ToList() );
			if ( is_null( $node ) )
			{
				throw XPath2Exception::withErrorCodeAndParam( "XPST0008", Resources::XPST0008, $clark );
			}

			$candidate = $node->getUnderlyingObject();
		}
		else
		{
			$candidate = $var->getUnderlyingObject();
		}

		$matched = array();
		$notMatched = array();

		$candidateParent = $candidate->parentNode;

		// The fact can be an
		foreach ( $facts as $fact )
		{
			$node = $fact->getUnderlyingObject();
			$factParent = $node->parentNode;

			if ( $candidateParent->isSameNode( $factParent ) )
			{
				$matched[] = $fact->CloneInstance();
			}
			else
			{
				$notMatched[] = $fact->CloneInstance();
			}
		}

		return DocumentOrderNodeIterator::fromItemset( $this->complement ? $notMatched : $matched );

		return $facts;
	}
1010826
private function getOverflowItems(ResultSet $resultSet): Generator
    {
        $includedPositions = [];
        foreach ($resultSet->getResults() as $result) {
            if ($result->getItem() instanceof ManualItem) {
                $includedPositions[] = $result->getItem()->getCollectionItem()->getPosition();
            }

            if ($result->getSubItem() instanceof ManualItem) {
                $includedPositions[] = $result->getSubItem()->getCollectionItem()->getPosition();
            }
        }

        foreach ($resultSet->getCollection()->getItems() as $item) {
            if (!in_array($item->getPosition(), $includedPositions, true)) {
                yield $item;
            }
        }
    }
791365
public static function getColumnLabels(ResultSet $resultSet)
    {
        $columnLabels = [];
        foreach ($resultSet->getColumnTypes() as $columnType) {
            $columnLabels[] = $columnType->getLabelName();
        }

        return $columnLabels;
    }
600278
protected function getResultTable($results)
    {
        $resultSet = 1;
        $resultTable     = \MUtil_Html::create()->array();
        foreach ($results as $result) {
            if (is_string($result)) {
                $this->addMessage($result);
            } else {
                $resultRow = $resultTable->echo($result, sprintf($this->_('Result set %s.'), $resultSet++));
                $resultRow->class = 'browser';
            }
        }
        return $resultTable;
    }