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