def _assign_renderer(class_reference, base_path, engine=None):
    """
    Assign the renderer to the given controller-type class.

    `class_reference` is a reference to a class type, not an instance of a class.

    The first argument called `source` is a name of the package containing templates and static contents.

    The second argument called `renderer_type` is a name of a renderer-type class used to override the default renderer.

    To use this, suppose we have a class called `DummyController` and later instantiate
    a variable `dummy_controller` as an instance of class `DummyController`. `class_reference`
    will be `DummyController`, not `dummy_controller`.

    Note that this method is not for direct use. You can invoke via `@renderer` or the
    configuration file only via `tori.application.Application`.

    Additionally, the arguments might be different if the renderer is not the default one.
    """
    class_reference._template_base_path = base_path
    class_reference._template_engine = engine
    return class_reference
