Create a proxy for a Widget

    :param widget: A gtk.Widget to proxy

    This will raise a KeyError if there is no proxy type registered for the
    widget type.

def proxy_for(widget):
    """Create a proxy for a Widget

    :param widget: A gtk.Widget to proxy

    This will raise a KeyError if there is no proxy type registered for the
    widget type.
    """
    proxy_type = widget_proxies.get(widget.__class__)
    if proxy_type is None:
        raise KeyError('There is no proxy type registered for %r' % widget)
    return proxy_type(widget)