def requires_training_wheels(f):
    """
    A decorator for model functions where the model needs training first.
    """
    def wrapper(model, *args, **kwargs):
        if not model._trained:
            raise TypeError("the model needs training first")
        return f(model, *args, **kwargs)
    return wrapper