'Generate a Custom widget
@param r: the S3Request instance
@param widget: the widget definition as dict
@param attr: controller attributes for the request'

def _custom(self, r, widget, **attr):

    label = widget.get('label', '')
    if label:
        label = current.T(label)
    icon = widget.get('icon', '')
    if icon:
        icon = ICON(icon)
    _class = self._lookup_class(r, widget)
    contents = widget['fn'](r, **attr)
    output = DIV(H4(icon, label, _class='profile-sub-header'), DIV(contents, _class='card-holder'), _class=_class)
    return output
