<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_widget_attrs(self, bound_field, attrs):
 """ Update the dictionary of attributes used while rendering the input widget """

        bound_field.form.update_widget_attrs(bound_field, attrs)
        widget_classes = self.widget.attrs.get('class', None)
        if widget_classes:
            if 'class' in attrs:
                attrs['class'] += ' ' + widget_classes
            else:
                attrs.update({'class': widget_classes})
        return attrs