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