This is in argprocess.py as well.  Perhaps we can pull them out into a utils module so we there's a single place this is defined.