Turn a FrameFunction into an Animation.

    Args:
        frame_function: A function that returns a FrameGenerator.

    Returns:
        an Animation decorator function.

def animation(frame_function: types.FrameFunction) -> types.Animation:
    """Turn a FrameFunction into an Animation.

    Args:
        frame_function: A function that returns a FrameGenerator.

    Returns:
        an Animation decorator function.
    """
    animation_ = core.Animation(frame_function)

    @functools.wraps(frame_function)
    def wrapper(*args, **kwargs):
        return animation_(*args, **kwargs)

    return wrapper