def assert_no_overwrite(call, shapes, dtypes=None):
 if (dtypes is None):
  dtypes = [np.float32, np.float64, np.complex64, np.complex128]
 for dtype in dtypes:
  for order in ['C', 'F']:
   for faker in [_id, _FakeMatrix, _FakeMatrix2]:
    orig_inputs = [_get_array(s, dtype) for s in shapes]
    inputs = [faker(x.copy(order)) for x in orig_inputs]
    call(*inputs)
    msg = ('call modified inputs [%r, %r]' % (dtype, faker))
    for (a, b) in zip(inputs, orig_inputs):
     np.testing.assert_equal(a, b, err_msg=msg)

def assert_no_overwrite ( call , shapes , dtypes = None ) : if ( dtypes is None ) : dtypes = [ np . float32 , np . float64 , np . complex64 , np . complex128 ] for dtype in dtypes : for order in [ 'C' , 'F' ] : for faker in [ _id , _FakeMatrix , _FakeMatrix2 ] : orig_inputs = [ _get_array ( s , dtype ) for s in shapes ] inputs = [ faker ( x . copy ( order ) ) for x in orig_inputs ] call ( * inputs ) msg = ( 'call modified inputs [%r, %r]' % ( dtype , faker ) ) for ( a , b ) in zip ( inputs , orig_inputs ) : np . testing . assert_equal ( a , b , err_msg = msg )
test that a call does not overwrite its input arguments .