def get_distinct_translations(units):
 targets = {}
 result = []
 for unit in units:
  if (unit.target in targets):
   continue
  targets[unit.target] = 1
  result.append(unit)
 return result

def get_distinct_translations ( units ) : targets = { } result = [ ] for unit in units : if ( unit . target in targets ) : continue targets [ unit . target ] = 1 result . append ( unit ) return result
returns list of distinct translations .