def get_ngaussians(fit):
    """Determine the number of gaussians in a :class:`lmfit.model.Model`.

    Parameters
    ----------
    fit : :class:`lmfit.model.Model` or :class:`lmfit.model.ModelResult`
        The model to analyze.

    Returns
    -------
    int
        The number of components whose name contains "gaussian".
    """
    return sum(["gaussian" in comp._name for comp in fit.components])