<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def html_to_file(html, file_path=None, open_browser=False):
 """Save the html to an html file adapting the paths to the filesystem. if a file_path is passed, it is used, if not a unique_filename is generated. :param html: the html for the output file. :type html: str :param file_path: the path for the html output file. :type file_path: str :param open_browser: if true open the generated html in an external browser :type open_browser: bool """

    if file_path is None:
        file_path = unique_filename(suffix='.html')

    # Ensure html is in unicode for codecs module
    html = html
    with codecs.open(file_path, 'w', encoding='utf-8') as f:
        f.write(html)

    if open_browser:
        open_in_browser(file_path)