# pyewjn python port of `nam_analysis`