#NEWLINE# @ classmethod #NEWLINE# def get_transform( cls , spec ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return cls . spec_map [ spec [ 'type' ] ] . wrap ( spec ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise BadSpecError ( _ ( 'Invalid or missing transform type: {}. Valid options are: {}' ) . format ( spec . get ( 'type' , None ) , ', ' . join ( cls . spec_map . keys ( ) ) ) ) #NEWLINE# #UNINDENT# except BadValueError as e : #NEWLINE# #INDENT# raise BadSpecError ( _ ( 'Problem creating transform: {}. Message is: {}' ) . format ( json . dumps ( spec , indent = 2 ) , str ( cls ) ) )