Merge restored neurokernel/tools/misc.py into master.