<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save(self, data, chart_type, options=None, filename='chart', w=800, h=420, overwrite=True):
 """Save the rendered html to a file in the same directory as the notebook."""

        html = self.render(
            data=data,
            chart_type=chart_type,
            options=options,
            div_id=filename,
            head=self.head,
            w=w,
            h=h)

        if overwrite:
            with open(filename.replace(" ", "_") + '.html', 'w') as f:
                f.write(html)
        else:
            if not os.path.exists(filename.replace(" ", "_") + '.html'):
                with open(filename.replace(" ", "_") + '.html', 'w') as f:
                    f.write(html)
            else:
                raise IOError('File Already Exists!')