<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_rows_by_cols(self, matching_dict):
 """Return all rows where the cols match the elements given in the matching_dict Parameters matching_dict: :obj:'dict' Desired dictionary of col values. Returns ------- :obj:`list` A list of rows that satisfy the matching_dict """

        result = []
        for i in range(self.num_rows):
            row = self._table[i+1]
            matching = True
            for key, val in matching_dict.items():
                if row[key] != val:
                    matching = False
                    break

            if matching:
                result.append(row)

        return result