<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def flash(self, duration=0.0):
 """ Flash a group. :param duration: How quickly to flash (in seconds). """

        for _ in range(2):
            self.on = not self.on
            time.sleep(duration)