def to_numpy(m, **options):
 dtype = options.get('dtype', 'complex')
 if isinstance(m, (Matrix, Expr)):
  return sympy_to_numpy(m, dtype=dtype)
 elif isinstance(m, numpy_ndarray):
  return m
 elif isinstance(m, scipy_sparse_matrix):
  return m.todense()
 raise TypeError(('Expected sympy/numpy/scipy.sparse matrix, got: %r' % m))

def to_numpy ( m , ** options ) : dtype = options . get ( 'dtype' , 'complex' ) if isinstance ( m , ( Matrix , Expr ) ) : return sympy_to_numpy ( m , dtype = dtype ) elif isinstance ( m , numpy_ndarray ) : return m elif isinstance ( m , scipy_sparse_matrix ) : return m . todense ( ) raise TypeError ( ( 'Expected sympy/numpy/scipy.sparse matrix, got: %r' % m ) )
convert a sympy/scipy .