def absolute_coordinate(coord_string):
 m = ABSOLUTE_RE.match(coord_string.upper())
 if m:
  parts = m.groups()
  if all(parts[(-2):]):
   return ('$%s$%s:$%s$%s' % (parts[0], parts[1], parts[3], parts[4]))
  else:
   return ('$%s$%s' % (parts[0], parts[1]))
 else:
  return coord_string

def absolute_coordinate ( coord_string ) : m = ABSOLUTE_RE . match ( coord_string . upper ( ) ) if m : parts = m . groups ( ) if all ( parts [ ( - 2 ) : ] ) : return ( '$%s$%s:$%s$%s' % ( parts [ 0 ] , parts [ 1 ] , parts [ 3 ] , parts [ 4 ] ) ) else : return ( '$%s$%s' % ( parts [ 0 ] , parts [ 1 ] ) ) else : return coord_string
convert a coordinate to an absolute coordinate string .