<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _n_onset_midi(patterns):
 """Computes the number of onset_midi objects in a pattern Parameters patterns : A list of patterns using the format returned by :func:`mir_eval.io.load_patterns()` Returns ------- n_onsets : int Number of onsets within the pattern. """

    return len([o_m for pat in patterns for occ in pat for o_m in occ])