<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _match_to_array(m):
 """ Returns an array consisting of the elements obtained from a pattern search cast into their appropriate classes. """

    return [_cast_biopax_element(m.get(i)) for i in range(m.varSize())]