<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_Bar(file, bar, bpm=120, repeat=0, verbose=False):
 """Write a mingus.Bar to a MIDI file. Both the key and the meter are written to the file as well. """

    m = MidiFile()
    t = MidiTrack(bpm)
    m.tracks = [t]
    while repeat >= 0:
        t.play_Bar(bar)
        repeat -= 1
    return m.write_file(file, verbose)