<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def rows(self, table, cols):
        '''
        Fetches rows from the local cache or from the db if there's no cache.

            :param table: table name to select
            :cols: list of columns to select
            :return: list of rows
            :rtype: list
        '''
        if self.orng_tables:
            data = []
            for ex in self.orng_tables[table]:
                data.append([ex[str(col)] for col in cols])
            return data
        else:
            return self.fetch(table, cols)