#NEWLINE# def common_params( task_instance , task_cls ) : #NEWLINE# #INDENT# '\n    Grab all the values in task_instance that are found in task_cls.\n    ' #NEWLINE# if ( not isinstance ( task_cls , task . Register ) ) : #NEWLINE# #INDENT# raise TypeError ( 'task_cls must be an uninstantiated Task' ) #NEWLINE# #UNINDENT# task_instance_param_names = dict ( task_instance . get_params ( ) ) . keys ( ) #NEWLINE# task_cls_param_names = dict ( task_cls . get_params ( ) ) . keys ( ) #NEWLINE# common_param_names = list ( set . intersection ( set ( task_instance_param_names ) , set ( task_cls_param_names ) ) ) #NEWLINE# common_param_vals = [ ( key , dict ( task_cls . get_params ( ) ) [ key ] ) for key in common_param_names ] #NEWLINE# common_kwargs = dict ( [ ( vals , task_instance . param_kwargs [ key ] ) for key in common_param_names ] ) #NEWLINE# vals = dict ( task_instance . get_param_values ( common_param_vals , [ ] , common_kwargs ) ) #NEWLINE# return vals