def to_java_array(m):
if not hasattr(m, '<STR_LIT>'): return m<EOL>m = np.asarray(m)<EOL>if np.issubdtype(m.dtype, np.dtype(int).type) or all(isinstance(x, num.Integral) for x in m):<EOL><INDENT>return to_java_ints(m)<EOL><DEDENT>else:<EOL><INDENT>return to_java_doubles(m)<EOL><DEDENT>
to_java_array(m) yields to_java_ints(m) if m is an array of integers and to_java_doubles(m) if
m is anything else. The numpy array m is tested via numpy.issubdtype(m.dtype, numpy.int64).