def test_object_size():
 assert_true((object_size(np.ones(10, np.float32)) < object_size(np.ones(10, np.float64))))
 for (lower, upper, obj) in ((0, 60, ''), (0, 30, 1), (0, 30, 1.0), (0, 60, 'foo'), (0, 150, np.ones(0)), (0, 150, np.int32(1)), (150, 500, np.ones(20)), (100, 400, dict()), (400, 1000, dict(a=np.ones(50))), (200, 900, sparse.eye(20, format='csc')), (200, 900, sparse.eye(20, format='csr'))):
  size = object_size(obj)
  assert_true((lower < size < upper), msg=('%s < %s < %s:\n%s' % (lower, size, upper, obj)))

def test_object_size ( ) : assert_true ( ( object_size ( np . ones ( 10 , np . float32 ) ) < object_size ( np . ones ( 10 , np . float64 ) ) ) ) for ( lower , upper , obj ) in ( ( 0 , 60 , '' ) , ( 0 , 30 , 1 ) , ( 0 , 30 , 1.0 ) , ( 0 , 60 , 'foo' ) , ( 0 , 150 , np . ones ( 0 ) ) , ( 0 , 150 , np . int32 ( 1 ) ) , ( 150 , 500 , np . ones ( 20 ) ) , ( 100 , 400 , dict ( ) ) , ( 400 , 1000 , dict ( a = np . ones ( 50 ) ) ) , ( 200 , 900 , sparse . eye ( 20 , format = 'csc' ) ) , ( 200 , 900 , sparse . eye ( 20 , format = 'csr' ) ) ) : size = object_size ( obj ) assert_true ( ( lower < size < upper ) , msg = ( '%s < %s < %s:\n%s' % ( lower , size , upper , obj ) ) )
test object size estimation .