<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_size(self, width, height):
 """Set the widget size. Args: width (int or str):
 An optional width for the widget (es. width=10 or width='10px' or width='10%'). height (int or str):
 An optional height for the widget (es. height=10 or height='10px' or height='10%'). """

        if width is not None:
            try:
                width = to_pix(int(width))
            except ValueError:
                # now we know w has 'px or % in it'
                pass
            self.style['width'] = width

        if height is not None:
            try:
                height = to_pix(int(height))
            except ValueError:
                # now we know w has 'px or % in it'
                pass
            self.style['height'] = height