def check_sparsity(x, fraction=<NUM_LIT>):
if not sps.issparse(x): return x<EOL>n = numel(x)<EOL>if n == <NUM_LIT:0>: return x<EOL>if len(x.data) / float(x) > <NUM_LIT>: return x.toarray()<EOL>else: return x<EOL>
check_sparsity(x) yields either x or an array equivalent to x with a different sparsity based on
  a heuristic: if x is a sparse array with more than 60% of its elements specified, it is made
  dense; otherwise, it is left alone.

The optional argument fraction (default 0.6) specifies the fraction of elements that must be
specified in the array for it to be un-sparsified.