#NEWLINE# def _check_param_grid( param_grid ) : #NEWLINE# #INDENT# if hasattr ( param_grid , 'items' ) : #NEWLINE# #INDENT# param_grid = [ param_grid ] #NEWLINE# #UNINDENT# for p in param_grid : #NEWLINE# #INDENT# for v in p . values ( ) : #NEWLINE# #INDENT# if ( isinstance ( v , np . ndarray ) and ( v . ndim > 1 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Parameter array should be one-dimensional.' ) #NEWLINE# #UNINDENT# check = [ isinstance ( v , k ) for k in ( list , tuple , np . ndarray ) ] #NEWLINE# if ( True not in check ) : #NEWLINE# #INDENT# raise ValueError ( 'Parameter values should be a list.' ) #NEWLINE# #UNINDENT# if ( len ( v ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'Parameter values should be a non-empty list.' )