def METHOD_NAME(
    as_data, keywords, threshold=60, max_return=10, exclude=None, by_index=True
):
    """Find a record using keywords.
    It looks for keywords in the title/authors/keywords
    (for as much is available). Using the diflib package it creates
    a ranking based on token set matching.
    Arguments
    ---------
    as_data: asreview.data.ASReviewData
        ASReview data object to search
    keywords: str
        A string of keywords together, can be a combination.
    threshold: float
        Don't return records below this threshold.
    max_return: int
        Maximum number of records to return.
    exclude: list, numpy.ndarray
        List of indices that should be excluded in the search. You would
        put papers that were already labeled here for example.
    by_index: bool
        If True, use internal indexing.
        If False, use record ids for indexing.
    Returns
    -------
    list
        Sorted list of indexes that match best the keywords.
    """
    new_ranking = _get_fuzzy_scores(keywords, _match_string(as_data))
    sorted_idx = np.argsort(-new_ranking)
    best_idx = []
    if exclude is None:
        exclude = np.array([], dtype=int)
    for idx in sorted_idx:
        if (
            (not by_index and as_data.df.index.values[idx] in exclude)
            or by_index
            and idx in exclude
        ):
            continue
        if len(best_idx) >= max_return:
            break
        if len(best_idx) > 0 and new_ranking[idx] < threshold:
            break
        best_idx.append(idx)
    fuzz_idx = np.array(best_idx, dtype=int)
    if not by_index:
        fuzz_idx = as_data.df.index.values[fuzz_idx]
    return fuzz_idx.tolist()