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

def ungroupslice(groups,gslice):
  'this is a helper for contigsub.'
  'coordinate transform: takes a match from seqingroups() and transforms to ungrouped coordinates'
  eltsbefore=0
  for i in range(gslice[0]): eltsbefore+=len(groups[i])-1
  x=eltsbefore+gslice[1]; return [x-1,x+gslice[2]-1]