#NEWLINE# def get_autotest_clock( sampler ) : #NEWLINE# #INDENT# '\n    Returns a clock object suitable to be used as a pyglet app clock, which\n    will follow a test plan to advance time and take snapshots.\n\n    The clock object class depends on the pyglet version, and is determined automatically.\n\n    :Parameters:\n        `sampler` : obj\n            obj with interface sampler.next(last_app_time) -> next_app_time\n            Drives the app trough the desired states, take snapshots and handles\n            the app termination conditions.\n    ' #NEWLINE# if pyglet . version . startswith ( '1.1' ) : #NEWLINE# #INDENT# clock = AutotestClock ( sampler ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# clock = AutotestClock_12dev ( sampler ) #NEWLINE# #UNINDENT# return clock