<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def collapse_group_expr(groupx,cols,ret_row):
  "collapses columns matching the group expression. I'm sure this is buggy; look at a real DB's imp of this."
  for i,col in enumerate(cols.children):
    if col==groupx: ret_row[i]=ret_row[i][0]
  return ret_row