Extract the documents from the specified result.

@param result the result containing the documents

@return the documents
961258
@SuppressWarnings("unchecked")
    public static final List<Map<String, Object>> getDocuments(Map<String, Object> result) {
        if (MapUtils.isNotEmpty(result) && result.containsKey(RESPONSE_KEY)) {
            Map<String, Object> response = (Map<String, Object>)result.get(RESPONSE_KEY);
            if (MapUtils.isNotEmpty(response) && response.containsKey(DOCUMENTS_KEY)) {
                return  (List<Map<String, Object>>)response.get(DOCUMENTS_KEY);
            }
        }

        return null;
    }
1260260
public static <T> CollectionUpdateResult<T> noop(T result) {
    return new CollectionUpdateResult<>(Status.NOOP, result);
  }
338968
public static <T> IQueryResult<T> packageResult(List<T> results) {
        return packageResult(results, null);
    }
879044
protected Document getXPathResultAsDocument(String select,
                                                Document document)
        throws ConfigurationException, TransformerException, XpathException {
        DOMResult result = new DOMResult();
        performTransform(getCopyTransformation(select), document, result);
        return (Document) result.getNode();
    }
970728
public static void validateResults(Map<Integer, Object> results) {
        for (Object result : results.values()) {
            if (result != null && result instanceof CacheClearResponse) {
                Object response = ((CacheClearResponse) result).getResponse();
                if (response instanceof Throwable) {
                    ExceptionUtil.sneakyThrow((Throwable) response);
                }
            }
        }
    }
807894
public void returnToResultPool(Result result) {
        if (result != null) {
            result.reset();
            resultPool.add(result);
        }
    }
1018348
public static ArrayList<ResultsPartition> get(CaptureSearchResults results,
			WaybackRequest wbRequest) {
		return get(results, wbRequest, null);
	}
1359674
public static List<String> extractKeyword(String document, int size)
    {
        return TextRankKeyword.getKeywordList(document, size);
    }
313413
private List<String> getResultRows(Result<?> result, boolean logResult) {
        List<String> rows = new ArrayList<>();
        if (logResult) {
            for (Map<String, Object> columns : result.getRows()) {
                StringBuilder row = new StringBuilder();
                for (Map.Entry<String, Object> entry : columns.entrySet()) {
                    if (row.length() > 0) {
                        row.append(", ");
                    }
                    row.append(entry.getKey());
                    row.append('=');
                    String stringValue = getLabel(entry.getValue());
                    row.append(stringValue);
                }
                rows.add("  " + row.toString());
            }
        }
        return rows;
    }
804243
public function result_collections($result)
    {
        // Combine $collection and $expanded headers
        $collections = isset($result['$collection'])
            ? array($result['$collection'])
            : array();

        if (isset($result['$expanded'])) {
            foreach ($result['$expanded'] as $expanded_collection) {
                $collections[] = $expanded_collection;
            }
        }

        return $collections;
    }
909047
public Document getResultDocument() throws TransformerException {
        return withExceptionHandling(new Trans<Document>() {
                public Document transform() {
                    return transformation.transformToDocument();
                }
            });
    }
1074924
private Map processEvent(MatchResult result) {
    Map map = new HashMap();
    //group zero is the entire match - process all other groups
    for (int i = 1; i < result.groupCount() + 1; i++) {
      Object key = matchingKeywords.get(i - 1);
      Object value = result.group(i);
      map.put(key, value);

    }
    return map;
  }
739530
private List<String> getValues(UserCoreResult<?, ?, ?> results) {

		List<String> values = null;
		if (results != null) {
			try {
				if (results.getCount() > 0) {
					int columnIndex = results.getColumnIndex(COLUMN_VALUE);
					values = getColumnResults(columnIndex, results);
				} else {
					values = new ArrayList<>();
				}
			} finally {
				results.close();
			}
		} else {
			values = new ArrayList<>();
		}

		return values;
	}
16630
@Override
  public URIParsedResult parse(Result result) {
    String rawText = getMassagedText(result);
    // We specifically handle the odd "URL" scheme here for simplicity and add "URI" for fun
    // Assume anything starting this way really means to be a URI
    if (rawText.startsWith("URL:") || rawText.startsWith("URI:")) {
      return new URIParsedResult(rawText.substring(4).trim(), null);
    }
    rawText = rawText.trim();
    if (!isBasicallyValidURI(rawText) || isPossiblyMaliciousURI(rawText)) {
      return null;
    }
    return new URIParsedResult(rawText, null);
  }
977467
function collectionResult (results) {
    // get context by executing any pre methods on collection views
    return this.collectionResultPre()
    // apply views to each record
    .then(context => {
        // if there are no results then do nothing
        if (!Array.isArray(results) || !results.length) {
            return context
        }
        // check if full records were loaded
        return this.query.limit === 1 || this.query.all
            // apply views to results directly
            ? this.collectionResultList(context, results)
            // create result object to iterate over results
            : this.collectionResultIterator(context, results)
    })
    // apply any post methods to context and return result
    .then(context => {
        return this.collectionResultPost(context)
    })
}
378936
def parse_result(cls, result):
        
        if isinstance(result, tuple) == 2:
            items, context = result
        else:
            context = {}
            items = result
        return items, context
995643
public function reformatResult($result)
    {
        $collection = new Collection($result);
        
        switch ($this->format) {
            case 'json':
                return $collection->toJson();
                break;

            case 'object':
               return json_decode(json_encode($collection->toArray()), false);
               break;

            default:
                return $collection->toArray();
                break;
        }
    }