def ShortenParameterNames(params):
 out = {}
 for (name, value) in params.iteritems():
  short_name = LONG_NAMES.get(name, name)
  if (short_name in out):
   raise KeyError(('Both long and short version of parameter %s (%s) found.  It is unclear which one to use.' % (name, short_name)))
  out[short_name] = value
 return out

def ShortenParameterNames ( params ) : out = { } for ( name , value ) in params . iteritems ( ) : short_name = LONG_NAMES . get ( name , name ) if ( short_name in out ) : raise KeyError ( ( 'Both long and short version of parameter %s (%s) found.  It is unclear which one to use.' % ( name , short_name ) ) ) out [ short_name ] = value return out
shorten long parameter names to short names .