<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_main(self) -> 'table[category: str][label: str][date: date]': """ Returns a table with the above typesignature """


        raw_table = self.get_raw_table("M")
        categories = raw_table[0]
        labels = raw_table[1]
        dates = self.get_dates(raw_table)

        def next_cat_col(i):
            n = 1
            while True:
                if i+n > len(categories)-1:
                    return i
                if categories[i+n]:
                    return i+n
                n += 1

        def get_category_labels(i):
            end_col = next_cat_col(i)
            return zip(range(i, end_col), labels[i:end_col])

        def get_label_cells(category, label):
            ci = categories.index(category)
            i = labels.index(label, ci)
            cells = {}
            for j, d in enumerate(dates):
                cell = raw_table[j+2][i]
                if cell and cell != "#VALUE!":
                    cells[d] = cell
            return cells

        table = {}
        for i, cat in enumerate(categories):
            if not cat:
                continue
            table[cat] = {}
            for i, label in get_category_labels(i):
                table[cat][label] = get_label_cells(cat, label)

        return table