<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def split_sparse_matrix(matrix, num_categories):
 """ An analog of numpy.split for our sparse matrix. If the number of categories does not divide the number of rows in the matrix, all overflow is placed in the final bin. In the event that there are more categories than rows, all later categories are considered to be an empty sparse matrix. """

  if matrix.nRows() < num_categories:
    return [matrix.getSlice(i, i+1, 0, matrix.nCols())
        for i in range(matrix.nRows())] + [SM32()
        for i in range(num_categories - matrix.nRows())]
  else:
    inc = matrix.nRows()/num_categories
    divisions = [matrix.getSlice(i*inc, (i+1)*inc, 0, matrix.nCols())
        for i in range(num_categories - 1)]

    # Handle the last bin separately.  All overflow goes into it.
    divisions.append(matrix.getSlice((num_categories - 1)*inc, matrix.nRows(),
        0, matrix.nCols()))

    return divisions