#NEWLINE# def _can_use_numexpr( op , op_str , a , b , dtype_check ) : #NEWLINE# #INDENT# ' return a boolean if we WILL be using numexpr ' #NEWLINE# if ( op_str is not None ) : #NEWLINE# #INDENT# if ( np . prod ( a . shape ) > _MIN_ELEMENTS ) : #NEWLINE# #INDENT# dtypes = set ( ) #NEWLINE# for o in [ a , b ] : #NEWLINE# #INDENT# if hasattr ( o , 'get_dtype_counts' ) : #NEWLINE# #INDENT# s = o . get_dtype_counts ( ) #NEWLINE# if ( len ( s ) > 1 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# dtypes |= set ( s . index ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( o , np . ndarray ) : #NEWLINE# #INDENT# dtypes |= set ( [ o . dtype . name ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( not len ( dtypes ) ) or ( _ALLOWED_DTYPES [ dtype_check ] >= dtypes ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return False