cherrypick gnacs.py and custom_output from master