#NEWLINE# def __init__( self , name , category , method ) : #NEWLINE# #INDENT# if ( category not in self . valid_categories ) : #NEWLINE# #INDENT# raise ValueError ( 'Invalid category: {}' . format ( category ) ) #NEWLINE# #UNINDENT# if ( ( not callable ( method ) ) and ( method not in self . valid_methods ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Invalid method: {}' . format ( method ) ) #NEWLINE# #UNINDENT# if ( ( category == 'scalar' ) and ( method == 'merge' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Method cannot be "merge" for a scalar' ) #NEWLINE# #UNINDENT# self . name = name #NEWLINE# self . category = category #NEWLINE# self . method = method