<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open_gif(self, filename):
 """ Open a gif file. Parameters filename : str Filename of the gif to open. Filename must end in gif. """

        if filename[-3:] != 'gif':
            raise Exception('Unsupported filetype.  Must end in .gif')
        if isinstance(vtki.FIGURE_PATH, str) and not os.path.isabs(filename):
            filename = os.path.join(vtki.FIGURE_PATH, filename)
        self._gif_filename = os.path.abspath(filename)
        self.mwriter = imageio.get_writer(filename, mode='I')