def write_options_to_file(self, filename, file_format='<STR_LIT>'):
if file_format.lower() == '<STR_LIT>':<EOL><INDENT>self.write_options_to_YAML(filename)<EOL><DEDENT>elif file_format.lower() == '<STR_LIT>':<EOL><INDENT>self.write_options_to_JSON(filename)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(file_format))<EOL><DEDENT>
Write options to file.

        This is a wrapper over :func:`.write_options_to_JSON` and
        :func:`.write_options_to_YAML`.

        :param str filename: Target file to write the options.
        :param str file_format: File format (``yaml`` or ``json``).

        :raises:
            :ValueError: If an unknown ``format`` is requested.