def fetch(cls, widget, wcls, size, focus):
    """
        Return the cached canvas or None.

        widget -- widget object requested
        wcls -- widget class that contains render() function
        size, focus -- render() parameters
        """
    cls.fetches += 1
    sizes = cls._widgets.get(widget, None)
    if not sizes:
        return None
    ref = sizes.get((wcls, size, focus), None)
    if not ref:
        return None
    canv = ref()
    if canv:
        cls.hits += 1
    return canv
