<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, filename, format=None):
 """ Saves the SArray to file. The saved SArray will be in a directory named with the `targetfile` parameter. Parameters filename : string A local path or a remote URL. If format is 'text', it will be saved as a text file. If format is 'binary', a directory will be created at the location which will contain the SArray. format : {'binary', 'text', 'csv'}, optional Format in which to save the SFrame. Binary saved SArrays can be loaded much faster and without any format conversion losses. 'text' and 'csv' are synonymous: Each SArray row will be written as a single line in an output text file. If not given, will try to infer the format from filename given. If file name ends with 'csv', 'txt' or '.csv.gz', then save as 'csv' format, otherwise save as 'binary' format. """

        from .sframe import SFrame as _SFrame

        if format is None:
            if filename.endswith(('.csv', '.csv.gz', 'txt')):
                format = 'text'
            else:
                format = 'binary'
        if format == 'binary':
            with cython_context():
                self.__proxy__.save(_make_internal_url(filename))
        elif format == 'text' or format == 'csv':
            sf = _SFrame({'X1':self})
            with cython_context():
                sf.__proxy__.save_as_csv(_make_internal_url(filename), {'header':False})
        else:
            raise ValueError("Unsupported format: {}".format(format))