<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_hyperedge_degree_matrix(M):
 """Creates the diagonal matrix of hyperedge degrees D_e as a sparse matrix, where a hyperedge degree is the cardinality of the hyperedge. :param M: the incidence matrix of the hypergraph to find the D_e matrix on. :returns: sparse.csc_matrix -- the diagonal hyperedge degree matrix as a sparse matrix. """

    degrees = M.sum(0).transpose()
    new_degree = []
    for degree in degrees:
        new_degree.append(int(degree[0:]))

    return sparse.diags([new_degree], [0])