Added sparse_expander.py from https://gist.github.com/ccsevers/10295174.