<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _write_report(report, file_path):
 """Write report to the given file path."""

        with open(file_path, mode='wb') as f:
            if not isinstance(report, binary_type):
                report = report.encode('utf-8')
            f.write(report)