<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def map_to_linear(self, with_stocks: bool=False):
 """ Maps the tree to a linear representation suitable for display """

        result = []

        for ac in self.model.classes:
            rows = self.__get_ac_tree(ac, with_stocks)
            result += rows
        return result