def METHOD_NAME(self):
    head = list()
    groups = list()
    use_groups = False
    for column in self.header:
        if isinstance(column, DataTablesColumnGroup):
            use_groups = True
            groups.extend([column.html] + [" "] * (len(column.columns) - 1))
            for child_columns in column.columns:
                head.append(child_columns.html)
        else:
            head.append(column.html)
            groups.append(" ")
    def unicodify(h):
        # HACK ideally we would not have to guess at the encoding of `h`
        # (when it is not unicode). Hopefully all byte strings that come
        # through here are encoded as UTF-8. If not, .decode() may blow up.
        return h if isinstance(h, (str, Promise)) else h.decode("utf-8")
    head = list(map(unicodify, head))
    if use_groups:
        return [groups, head]
    else:
        return [head]