def write_to_file(file_path, content, encoding=None):
try:<EOL><INDENT>with open(file_path, "<STR_LIT:wb>") as f:<EOL><INDENT>f.write(content.encode(encoding))<EOL><DEDENT><DEDENT>except:<EOL><INDENT>log.exception('<STR_LIT>'.format(file_path))<EOL>raise<EOL><DEDENT>
Write `content` inside the file in `file_path` with the given encoding.
    Parameters
    ----------
    file_path: str
        Path to the output file. Will be overwritten if exists.

    content: str
        The content you want in the file.

    encoding: str
        The name of the encoding.