def sort_result_artifact_filenames(list_of_artifact_filenames):
    """Sort the result artifact filenames

    Sorts the given list of result filenames by parameter index (assumed to be
    the beginning of the filename, preceding an underscore e.g.
    ``00004_*.qza``)

    Parameters
    ----------
    list_of_artifact_filenames : List
        A list of artifact filenames returned by the ``get_results`` method

    Returns
    -------
    sorted_artifact_filenames : List
        Sorted list of the found artifact filenames

    See Also
    --------
    q2_mlab.doctor.get_results

    """
    sorted_artifact_filenames = sorted(
        list_of_artifact_filenames, key=lambda name: int(name.split("_")[0])
    )
    return sorted_artifact_filenames