<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_resultsets(self, routine, *args):
 """Return a list of lists of dictionaries, for when a query returns more than one resultset. """


        (query, replacements) = self.__build_raw_query(routine, args)

        # Grab a raw connection from the connection-pool.
        connection = mm.db.ENGINE.raw_connection()

        sets = []

        try:
            cursor = connection.cursor()

            cursor.execute(query, replacements)

            while 1:
                #(column_name, type_, ignore_, ignore_, ignore_, null_ok, column_flags)
                names = [c[0] for c in cursor.description]

                set_ = []
                while 1:
                    row_raw = cursor.fetchone()
                    if row_raw is None:
                        break

                    row = dict(zip(names, row_raw))
                    set_.append(row)

                sets.append(list(set_))

                if cursor.nextset() is None:
                    break

# TODO(dustin): nextset() doesn't seem to be sufficiant to tell the end.
                if cursor.description is None:
                    break
        finally:
            # Return the connection to the pool (won't actually close).
            connection.close()

        return sets