def play(events, speed_factor=<NUM_LIT:1.0>, include_clicks=True, include_moves=True, include_wheel=True):
last_time = None<EOL>for event in events:<EOL><INDENT>if speed_factor > <NUM_LIT:0> and last_time is not None:<EOL><INDENT>_time.sleep((event.time - last_time) / speed_factor)<EOL><DEDENT>last_time = event.time<EOL>if isinstance(event, ButtonEvent) and include_clicks:<EOL><INDENT>if event.event_type == UP:<EOL><INDENT>_os_mouse.release(event.button)<EOL><DEDENT>else:<EOL><INDENT>_os_mouse.press(event.button)<EOL><DEDENT><DEDENT>elif isinstance(event, MoveEvent) and include_moves:<EOL><INDENT>_os_mouse.move_to(event.x, event.y)<EOL><DEDENT>elif isinstance(event, WheelEvent) and include_wheel:<EOL><INDENT>_os_mouse.wheel(event.delta)<EOL><DEDENT><DEDENT>
Plays a sequence of recorded events, maintaining the relative time
intervals. If speed_factor is <= 0 then the actions are replayed as fast
as the OS allows. Pairs well with `record()`.

The parameters `include_*` define if events of that type should be inluded
in the replay or ignored.