def at_search_result(matches, caller, query="", quiet=False, **kwargs):

    error = ""
    if not matches:
        # no results.
        error = kwargs.get("nofound_string") or _("Could not find '%s'." % query)
        matches = None
    elif len(matches) > 1:
        error = kwargs.get("multimatch_string", None)
        if not error:
            error = _("More than one match for '%s'" \
                     " (please narrow target):" % query)
            for num, result in enumerate(matches):
                error += "\n %i%s%s%s" % (
                    num + 1, _MULTIMATCH_SEPARATOR,
                    result.get_display_name(caller) if hasattr(result, "get_display_name") else result.key,
                    result.get_extra_info(caller))
        matches = None
    else:
        # exactly one match
        matches = matches[0]

    if error and not quiet:
        caller.msg(error.strip())
    return matches
This is a generic hook for handling all processing of a search
dataset/ETHPy150Open evennia/evennia/evennia/utils/utils.py/at_search_result