<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, path=None, filter_name=None):
 """ Saves this document to a local file system. The optional first argument defaults to the document's path. Accept optional second argument which defines type of the saved file. Use one of FILTER_* constants or see list of available filters at http://wakka.net/archives/7 or http://www.oooforum.org/forum/viewtopic.phtml?t=71294. """


        if path is None:
            try:
                self._target.store()
            except _IOException as e:
                raise IOError(e.Message)
            return

        # UNO requires absolute paths
        url = uno.systemPathToFileUrl(os.path.abspath(path))
        if filter_name:
            format_filter = uno.createUnoStruct('com.sun.star.beans.PropertyValue')
            format_filter.Name = 'FilterName'
            format_filter.Value = filter_name
            filters = (format_filter,)
        else:
            filters = ()
        # http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/XStorable.html#storeToURL
        try:
            self._target.storeToURL(url, filters)
        except _IOException as e:
            raise IOError(e.Message)