<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_as(self, filename=None):
 """ Dumps object contents into file on disk. Args: filename (optional):
 defaults to self.filename. If passed, self.filename will be updated to filename. """

        if filename is None:
            filename = self.filename
        if filename is None:
            filename = self.default_filename
        if filename is None:
            raise RuntimeError("Class '{}' has no default filename".format(self.__class__.__name__))
        self._do_save_as(filename)
        self.filename = filename