<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def header(self):
 """Return a header for type 1 MIDI file."""

        tracks = a2b_hex('%04x' % len([t for t in self.tracks if
            t.track_data != '']))
        return 'MThd\x00\x00\x00\x06\x00\x01' + tracks + self.time_division