human
Complete the below
@register.filter
def widont(value, count=1):

    ''''Adds an HTML non-breaking space between the final two words of the string to
    avoid "widowed" words.
    Examples:
    >>> print(widont(\'Test   me   out\'))
    Test   me&nbsp;out
    >>> print("\'",widont(\'It works with trailing spaces too  \'), "\'")
    \' It works with trailing spaces&nbsp;too   \'
    >>> print(widont(\'NoEffect\'))
    NoEffect'
    '''
assistant
#Here is the Python program you requested.
    def replace(matchobj):
        return force_text(('&nbsp;%s' % matchobj.group(1)))
    for i in range(count):
        value = re_widont.sub(replace, force_text(value))
    return value