def _map_fragment_list(flist, reflist):
 mapped = []
 for f in flist:
  rank = []
  for i in range(0, len(reflist)):
   rf = reflist[i]
   rms = (f - rf)
   rank.append((rms, rf))
  rank.sort()
  fragment = rank[0][1]
  mapped.append(fragment)
 return mapped

def _map_fragment_list ( flist , reflist ) : mapped = [ ] for f in flist : rank = [ ] for i in range ( 0 , len ( reflist ) ) : rf = reflist [ i ] rms = ( f - rf ) rank . append ( ( rms , rf ) ) rank . sort ( ) fragment = rank [ 0 ] [ 1 ] mapped . append ( fragment ) return mapped
map all frgaments in flist to the closest fragment in reflist .