<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_row_dict(self, row_idx):
 """ Return a dictionary representation for a matrix row :param row_idx: which row :return: a dict of feature keys/values, not including ones which are the default value """


        try:
            row = self._rows[row_idx]
        except TypeError:
            row = self._rows[self._row_name_idx[row_idx]]

        if isinstance(row, dict):
            return row

        else:
            if row_idx not in self._row_memo:
                self._row_memo[row_idx] = dict((self._column_name_list[idx], v) for idx, v in enumerate(row) if v != self._default_value)

            return self._row_memo[row_idx]