def _check_func_names(selected, feature_funcs_names):
    """ Checks if the names of selected feature functions match the available
    feature functions.

    Parameters
    ----------
    selected : list of str
        Names of the selected feature functions.

    feature_funcs_names : dict-keys or list
        Names of available feature functions.

    Returns
    -------
    valid_func_names : list of str
    """
    valid_func_names = list()
    for f in selected:
        if f in feature_funcs_names:
            valid_func_names.append(f)
        else:
            raise ValueError('The given alias (%s) is not valid. The valid '
                             'aliases for feature functions are: %s.' %
                             (f, feature_funcs_names))
    if not valid_func_names:
        raise ValueError('No valid feature function names given.')
    else:
        return valid_func_names