def write_to_file(self, filename, filetype=None):
if filetype == "<STR_LIT>" and not filename.endswith("<STR_LIT>"):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if filetype == "<STR_LIT>" and not filename.endswith("<STR_LIT>"):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>elif filetype is None and filename.endswith("<STR_LIT>"):<EOL><INDENT>filetype = "<STR_LIT>"<EOL><DEDENT>elif filetype is None and filename.endswith("<STR_LIT>"):<EOL><INDENT>filetype = "<STR_LIT>"<EOL><DEDENT>elif filetype is None and filename.endswith("<STR_LIT>"):<EOL><INDENT>filetype = "<STR_LIT>"<EOL><DEDENT>elif filetype is None:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if filetype == "<STR_LIT>":<EOL><INDENT>write_to_sdpa(self, filename)<EOL><DEDENT>elif filetype == "<STR_LIT>":<EOL><INDENT>task = convert_to_mosek(self)<EOL>task.writedata(filename)<EOL><DEDENT>elif filetype == "<STR_LIT>":<EOL><INDENT>write_to_human_readable(self, filename)<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>
Write the relaxation to a file.

        :param filename: The name of the file to write to. The type can be
                         autodetected from the extension: .dat-s for SDPA,
                         .task for mosek or .csv for human readable format.
        :type filename: str.
        :param filetype: Optional parameter to define the filetype. It can be
                         "sdpa" for SDPA , "mosek" for Mosek, or "csv" for
                         human readable format.
        :type filetype: str.