<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_brainvision(data, filename, markers=None):
 """Export data in BrainVision format Parameters data : instance of ChanTime data with only one trial filename : path to file file to export to (use '.vhdr' as extension) """

    filename = Path(filename).resolve().with_suffix('.vhdr')
    if markers is None:
        markers = []

    with filename.open('w') as f:
        f.write(_write_vhdr(data, filename))

    with filename.with_suffix('.vmrk').open('w') as f:
        f.write(_write_vmrk(data, filename, markers))

    _write_eeg(data, filename)