def METHOD_NAME(s):
    """Parses MIDI file data from the bytes string s.
    Returns a three tuple (format_type, time_division, tracks).
    Every track is an unparsed bytes string.
    May raise ValueError or IndexError in case of invalid MIDI data.
    """
    chunks = get_chunks(s)
    for name, data in chunks:
        if name == b'MThd':
            fmt, ntracks, division = unpack_midi_header(data[:6])
            tracks = [data for name, data in chunks if name == b'MTrk']
            return fmt, division, tracks
        break
    raise ValueError("invalid midi data")