<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reset_table_widget(t, rowCount, colCount):

 """Clears and resizes a table widget."""

    t.reset()
    t.horizontalHeader().reset()
    t.clear()
    t.sortItems(-1)
    t.setRowCount(rowCount)
    t.setColumnCount(colCount)