def vstack(tup):
if all([sps.issparse(u) for u in tup]): return sps.vstack(tup, format=tup[<NUM_LIT:0>].format)<EOL>else: return np.vstack([u.toarray() if sps.issparse(u) else u for u in tup])<EOL>
vstack(x) is equivalent to numpy.vstack(x) or scipy.sparse.vstack(x) except that it works
  correctly with both sparse and dense arrays (if any inputs are dense, it converts all inputs
  to dense arrays).