<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def render(self, filename):
 """Perform initialization of render, set quality and size video attributes and then call template method that is defined in child class. """

        self.elapsed_time = -time()
        dpi = 100
        fig = figure(figsize=(16, 9), dpi=dpi)
        with self.writer.saving(fig, filename, dpi):
            for frame_id in xrange(self.frames + 1):
                self.renderFrame(frame_id)
                self.writer.grab_frame()
        self.elapsed_time += time()