def compression_level(n, q, oversampling=10, min_subspace_size=20):
 return min(max(min_subspace_size, (q + oversampling)), n)

def compression_level ( n , q , oversampling = 10 , min_subspace_size = 20 ) : return min ( max ( min_subspace_size , ( q + oversampling ) ) , n )
compression level to use in svd_compressed given the size n of a space .