#NEWLINE# def get_sampler( parameters ) : #NEWLINE# #INDENT# if ( 'st' not in parameters ) : #NEWLINE# #INDENT# logger = logging . getLogger ( Logger . project_name ) #NEWLINE# logger . error ( 'Not sample_type provided by params in sampler.get_sample' ) #NEWLINE# raise Exception ( 'Not sample_type provided by params in sampler.get_sample' ) #NEWLINE# #UNINDENT# sample_type = parameters [ 'st' ] #NEWLINE# if ( st . full_sampler == sample_type ) : #NEWLINE# #INDENT# return FullSampler ( parameters ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( st . instance_sampler == sample_type ) : #NEWLINE# #INDENT# return InstanceSampler ( parameters ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger = logging . getLogger ( Logger . project_name ) #NEWLINE# logger . error ( ( 'Unknown sample_type %s' % sample_type ) ) #NEWLINE# raise Exception ( ( 'Unknown sample_type %s' % sample_type ) )