def use_renderer(r):
    global _renderer
    global _renderers
    if isinstance(r, Renderer):
        _renderer = r
    else:
        if r in _renderers:
            _renderer = _renderers[r]()
        else:
            raise ValueError('renderer could not be found: {0}').format(r)
Use a particular renderer, registered by name or an actual Renderer instance.
dataset/ETHPy150Open ellisonbg/altair/altair/api.py/use_renderer