def __modify_trace(self, replay, fps):
    """Adopt replay to the new framerate and add additional steps at the end."""
    trace = []
    min_fps = replay[0]['debug']['config']['physics_steps_per_frame']
    assert fps % min_fps == 0, (
        'Trace has to be rendered in framerate being multiple of {}'.format(
            min_fps))
    assert fps <= 100, ('Framerate of up to 100 is supported')
    empty_steps = int(fps / min_fps) - 1
    for f in replay:
      trace.append(f)
      idle_step = copy.deepcopy(f)
      idle_step['debug']['action'] = [football_action_set.action_idle
                                     ] * len(f['debug']['action'])
      for _ in range(empty_steps):
        trace.append(idle_step)
    # Add some empty steps at the end, so that we can record videos.
    for _ in range(10):
      trace.append(idle_step)
    return trace
Adopt replay to the new framerate and add additional steps at the end.
gfootball/env/script_helpers.py