def set_app_clock(clock):
    if pyglet.version.startswith('1.1'):
        # works with pyglet 1.1.4release
        pyglet.clock._default = clock
    else:
        # works with pyglet 1.2dev , branch default, 2638:ca17f2a533b7 (2012 04)
        pyglet.app.event_loop.clock = clock
        pyglet.clock._default = clock
        # pyglet.app.base.EventLoop._run_estimated murks the water by accessing
        # the clock's time provider (which is not in sync with our fake time),
        # so use _run instead
        pyglet.app.event_loop._run_estimated = pyglet.app.event_loop._run
Use this decorator on the dispatch method of a TemplateView subclass
dataset/ETHPy150Open los-cocos/cocos/cocos/custom_clocks.py/set_app_clock--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/style/decorators.py/use_select2