def _to_ndarray(self, a):
if isinstance(a, (list, tuple)):<EOL><INDENT>a = numpy.array(a)<EOL><DEDENT>if not is_ndarray(a):<EOL><INDENT>raise TypeError("<STR_LIT>".format(type(a)))<EOL><DEDENT>return a<EOL>
Casts Python lists and tuples to a numpy array or raises an AssertionError.